Esempio n. 1
0
static void DoCat()
{
    AJ_Status status;
    AJ_Message msg;

    /*
     * Set the object path so we can make a method call
     */
    (void)AJ_SetProxyObjectPath(proxyObjects, BASIC_CLIENT_CAT, serviceObjPath);

    status = AJ_MarshalMethodCall(&bus, &msg, BASIC_CLIENT_CAT, serviceName, sessionId, 0, METHOD_TIMEOUT);
    if (status == AJ_OK) {
        status = AJ_MarshalArgs(&msg, "ss", "Hello ", "World!");
    }
    if (status == AJ_OK) {
        status = AJ_DeliverMsg(&msg);
    }
    AJ_InfoPrintf(("MakeMethodCall() resulted in a status of 0x%04x.\n", status));
}
AJ_Status SendPing(AJ_BusAttachment* bus, uint32_t sessionId, unsigned int num)
{
    AJ_Status status;
    AJ_Message msg;

    /*
     * Since the object path on the proxy object entry was not set in the proxy object table above
     * it must be set before marshalling the method call.
     */
    status = AJ_SetProxyObjectPath(ProxyObjects, PRX_MY_PING, testObj);
    if (status == AJ_OK) {
        status = AJ_MarshalMethodCall(bus, &msg, PRX_MY_PING, ServiceName, sessionId, 0, METHOD_TIMEOUT);
    }
    if (status == AJ_OK) {
        status = AJ_MarshalArgs(&msg, "s", PingString);
    }
    if (status == AJ_OK) {
        status = AJ_DeliverMsg(&msg);
    }
    return status;
}