void DvProviderOpenhomeOrgTestBasic1::DoSetBinary(IDviInvocation& aInvocation)
{
    aInvocation.InvocationReadStart();
    Brh ValueBin;
    aInvocation.InvocationReadBinary("ValueBin", ValueBin);
    aInvocation.InvocationReadEnd();
    DviInvocation invocation(aInvocation);
    SetBinary(invocation, ValueBin);
}
void DvProviderLinnCoUkCloud1Cpp::DoSetAssociated(IDviInvocation& aInvocation)
{
    aInvocation.InvocationReadStart();
    Brh buf_AesKeyRsaEncrypted;
    aInvocation.InvocationReadBinary("AesKeyRsaEncrypted", buf_AesKeyRsaEncrypted);
    std::string AesKeyRsaEncrypted((const char*)buf_AesKeyRsaEncrypted.Ptr(), buf_AesKeyRsaEncrypted.Bytes());
    Brh buf_InitVectorRsaEncrypted;
    aInvocation.InvocationReadBinary("InitVectorRsaEncrypted", buf_InitVectorRsaEncrypted);
    std::string InitVectorRsaEncrypted((const char*)buf_InitVectorRsaEncrypted.Ptr(), buf_InitVectorRsaEncrypted.Bytes());
    Brh buf_TokenAesEncrypted;
    aInvocation.InvocationReadBinary("TokenAesEncrypted", buf_TokenAesEncrypted);
    std::string TokenAesEncrypted((const char*)buf_TokenAesEncrypted.Ptr(), buf_TokenAesEncrypted.Bytes());
    bool Associated = aInvocation.InvocationReadBool("Associated");
    aInvocation.InvocationReadEnd();
    DvInvocationStd invocation(aInvocation);
    SetAssociated(invocation, AesKeyRsaEncrypted, InitVectorRsaEncrypted, TokenAesEncrypted, Associated);
    aInvocation.InvocationWriteStart();
    aInvocation.InvocationWriteEnd();
}
void DvProviderOpenhomeOrgTestBasic1::DoEchoBinary(IDviInvocation& aInvocation)
{
    aInvocation.InvocationReadStart();
    Brh Value;
    aInvocation.InvocationReadBinary("Value", Value);
    aInvocation.InvocationReadEnd();
    DviInvocation invocation(aInvocation);
    DviInvocationResponseBinary respResult(aInvocation, "Result");
    EchoBinary(invocation, Value, respResult);
}
void DvProviderLinnCoUkFlash1Cpp::DoWrite(IDviInvocation& aInvocation)
{
    aInvocation.InvocationReadStart();
    uint32_t aId = aInvocation.InvocationReadUint("aId");
    uint32_t aAddress = aInvocation.InvocationReadUint("aAddress");
    Brh buf_aSource;
    aInvocation.InvocationReadBinary("aSource", buf_aSource);
    std::string aSource((const char*)buf_aSource.Ptr(), buf_aSource.Bytes());
    aInvocation.InvocationReadEnd();
    DvInvocationStd invocation(aInvocation);
    Write(invocation, aId, aAddress, aSource);
    aInvocation.InvocationWriteStart();
    aInvocation.InvocationWriteEnd();
}
Beispiel #5
0
int32_t DvInvocationReadBinary(DvInvocationC aInvocation, const char* aName, uint8_t** aData, uint32_t* aLen)
{
    IDviInvocation* invocation = InvocationFromHandle(aInvocation);
    try {
        Brh value;
        invocation->InvocationReadBinary(aName, value);
        *aLen = value.Bytes();
        *aData = (uint8_t*)value.Extract();
    }
    catch (InvocationError&) {
        return -1;
    }
    return 0;
}
void DvProviderLinnCoUkCloud1C::DoSetAssociated(IDviInvocation& aInvocation)
{
    DvInvocationCPrivate invocationWrapper(aInvocation);
    IDvInvocationC* invocationC;
    void* invocationCPtr;
    invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr);
    aInvocation.InvocationReadStart();
    Brh AesKeyRsaEncrypted;
    aInvocation.InvocationReadBinary("AesKeyRsaEncrypted", AesKeyRsaEncrypted);
    Brh InitVectorRsaEncrypted;
    aInvocation.InvocationReadBinary("InitVectorRsaEncrypted", InitVectorRsaEncrypted);
    Brh TokenAesEncrypted;
    aInvocation.InvocationReadBinary("TokenAesEncrypted", TokenAesEncrypted);
    TBool Associated = aInvocation.InvocationReadBool("Associated");
    aInvocation.InvocationReadEnd();
    DviInvocation invocation(aInvocation);
    ASSERT(iCallbackSetAssociated != NULL);
    if (0 != iCallbackSetAssociated(iPtrSetAssociated, invocationC, invocationCPtr, (const char*)AesKeyRsaEncrypted.Ptr(), AesKeyRsaEncrypted.Bytes(), (const char*)InitVectorRsaEncrypted.Ptr(), InitVectorRsaEncrypted.Bytes(), (const char*)TokenAesEncrypted.Ptr(), TokenAesEncrypted.Bytes(), Associated)) {
        invocation.Error(502, Brn("Action failed"));
        return;
    }
    invocation.StartResponse();
    invocation.EndResponse();
}
void DvProviderAvOpenhomeOrgCredentials1C::DoSet(IDviInvocation& aInvocation)
{
    DvInvocationCPrivate invocationWrapper(aInvocation);
    IDvInvocationC* invocationC;
    void* invocationCPtr;
    invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr);
    aInvocation.InvocationReadStart();
    Brhz Id;
    aInvocation.InvocationReadString("Id", Id);
    Brhz UserName;
    aInvocation.InvocationReadString("UserName", UserName);
    Brh Password;
    aInvocation.InvocationReadBinary("Password", Password);
    aInvocation.InvocationReadEnd();
    DviInvocation invocation(aInvocation);
    ASSERT(iCallbackSet != NULL);
    if (0 != iCallbackSet(iPtrSet, invocationC, invocationCPtr, (const char*)Id.Ptr(), (const char*)UserName.Ptr(), (const char*)Password.Ptr(), Password.Bytes())) {
        invocation.Error(502, Brn("Action failed"));
        return;
    }
    invocation.StartResponse();
    invocation.EndResponse();
}