Set stream port Unix SDK


#1

Product: [Bebop]
Product version: [4.0.6]
SDK version: [3]
Use of libARController: [YES] (Only for ARSDK)
SDK platform: [Unix]
Reproductible with the official app: [Not tried]
Hi, I would like to know if there is a way to set which port (eg 55004) to send the stream data. For now we can only start streaming but it is send in a random port; so we don’t know where we can receive it.
Currently we are connecting to our drone with this code:

failed = 0;
if (!failed)
{
    ARSAL_PRINT(ARSAL_PRINT_INFO, TAG, "- init discovey device ... ");
    eARDISCOVERY_ERROR errorDiscovery = ARDISCOVERY_OK;
    device = ARDISCOVERY_Device_New (&errorDiscovery);
    if (errorDiscovery == ARDISCOVERY_OK)
    {
        ARSAL_PRINT(ARSAL_PRINT_INFO, TAG, "    - ARDISCOVERY_Device_InitWifi ...");
        // create a Bebop drone discovery device (ARDISCOVERY_PRODUCT_ARDRONE)

        errorDiscovery = ARDISCOVERY_Device_InitWifi (device, ARDISCOVERY_PRODUCT_ARDRONE, "bebop", BEBOP_IP_ADDRESS, BEBOP_DISCOVERY_PORT);

        if (errorDiscovery != ARDISCOVERY_OK)
        {
            failed = 1;
            ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "Discovery error :%s", ARDISCOVERY_Error_ToString(errorDiscovery));
        }
    }
    else
    {
        ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "Discovery error :%s", ARDISCOVERY_Error_ToString(errorDiscovery));
        failed = 1;
    }
}

// create a device controller
if (!failed)
{
    deviceController = ARCONTROLLER_Device_New (device, &error);

    if (error != ARCONTROLLER_OK)
    {
        ARSAL_PRINT (ARSAL_PRINT_ERROR, TAG, "Creation of deviceController failed.");
        failed = 1;
    }
}

if (!failed)
{
    ARSAL_PRINT(ARSAL_PRINT_INFO, TAG, "- delete discovey device ... ");
    ARDISCOVERY_Device_Delete (&device);
}

// add the state change callback to be informed when the device controller starts, stops...
if (!failed)
{
    error = ARCONTROLLER_Device_AddStateChangedCallback (deviceController, stateChanged, deviceController);

    if (error != ARCONTROLLER_OK)
    {
        ARSAL_PRINT (ARSAL_PRINT_ERROR, TAG, "add State callback failed.");
        failed = 1;
    }
}

// add the command received callback to be informed when a command has been received from the device
if (!failed)
{
    error = ARCONTROLLER_Device_AddCommandReceivedCallback (deviceController, commandReceived, deviceController);

    if (error != ARCONTROLLER_OK)
    {
        ARSAL_PRINT (ARSAL_PRINT_ERROR, TAG, "add callback failed.");
        failed = 1;
    }
}

if (!failed)
{
    ARSAL_PRINT(ARSAL_PRINT_INFO, TAG, "Connecting ...");
    error = ARCONTROLLER_Device_Start (deviceController);

    if (error != ARCONTROLLER_OK)
    {
        failed = 1;
        ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "- error :%s", ARCONTROLLER_Error_ToString(error));
    }
}

if (!failed)
{
    // wait state update update
    ARSAL_Sem_Wait (&(stateSem));

    deviceState = ARCONTROLLER_Device_GetState (deviceController, &error);

    if ((error != ARCONTROLLER_OK) || (deviceState != ARCONTROLLER_DEVICE_STATE_RUNNING))
    {
        failed = 1;
        ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "- deviceState :%d", deviceState);
        ARSAL_PRINT(ARSAL_PRINT_ERROR, TAG, "- error :%s", ARCONTROLLER_Error_ToString(error));
    }
}

Thanks!