BBBAutomation

Main focus at the moment is transparent message passing between the REST server and the actual application. Current setup:

Client

int main()
{
    API cAPI(/* isServer */ false);
    float temperature;
    cAPI.CallFunction(API::ReadTemp, NULL, 0, &temp, sizeof(temperature));
    printf("Current temperature: %f", temperature);
}

Server

class API_impl : public API
{
public:
    API_impl(bool isServer) : API(isServer) {}
    virtual void Callback(API_CALL call, const void *rcvData, const size_t rcvDataLen, 
        void *&sendData, int *sendDataLen)
    {
        if (call == API::ReadTemp)
        {
            sendData = new float;
            *((float*)sendData) = 81.5f;
            *sendDataLen = sizeof(float);
        }
    }
};

int main()
{
    API_impl sAPI(true);
    while (true)
    {
        sleep(1);
        sAPI.CallbackWrapper();
    }
    return 0;
}
Most of these files are released under the AGPL v3 license http://www.gnu.org/licenses/agpl.html. Check individual files for more details.

BlackLib (C) 2013-2014 by Yigit YUCE released under LGPLv3 (or later)

Built With

Share this project:

Updates