1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Need to add hooks in sendObject and receiveObject to actually transmit _TS objects

This commit is contained in:
James Cotton 2012-07-24 02:41:39 -05:00
parent 858c2cd512
commit ea5c3be026
2 changed files with 8 additions and 12 deletions

View File

@ -179,7 +179,7 @@ static void overoSyncTask(void *parameters)
if (xQueueReceive(queue, &ev, portMAX_DELAY) == pdTRUE) {
// Process event. This calls transmitData
UAVTalkSendObject(uavTalkCon, ev.obj, ev.instId, false, 0);
UAVTalkSendObjectTimestamped(uavTalkCon, ev.obj, ev.instId, false, 0);
updateTime = xTaskGetTickCount();
if(((portTickType) (updateTime - lastUpdateTime)) > 1000) {
@ -209,14 +209,10 @@ static void overoSyncTask(void *parameters)
*/
static int32_t packData(uint8_t * data, int32_t length)
{
portTickType tickTime = xTaskGetTickCount();
if( PIOS_COM_SendBufferNonBlocking(pios_com_overo_id, (uint8_t *) &tickTime, sizeof(tickTime)) < 0)
goto fail;
if( PIOS_COM_SendBufferNonBlocking(pios_com_overo_id, data, length) < 0)
goto fail;
overosync->sent_bytes += length + 4;
overosync->sent_bytes += length;
return length;

View File

@ -244,7 +244,7 @@ static int32_t objectTransaction(UAVTalkConnectionData *connection, UAVObjHandle
int32_t respReceived;
// Send object depending on if a response is needed
if (type == UAVTALK_TYPE_OBJ_ACK || type == UAVTALK_TYPE_OBJ_REQ)
if (type == UAVTALK_TYPE_OBJ_ACK || type == UAVTALK_TYPE_OBJ_ACK_TS || type == UAVTALK_TYPE_OBJ_REQ)
{
// Get transaction lock (will block if a transaction is pending)
xSemaphoreTakeRecursive(connection->transLock, portMAX_DELAY);
@ -273,10 +273,10 @@ static int32_t objectTransaction(UAVTalkConnectionData *connection, UAVObjHandle
return 0;
}
}
else if (type == UAVTALK_TYPE_OBJ)
else if (type == UAVTALK_TYPE_OBJ || type == UAVTALK_TYPE_OBJ_TS)
{
xSemaphoreTakeRecursive(connection->lock, portMAX_DELAY);
sendObject(connection, obj, instId, UAVTALK_TYPE_OBJ);
sendObject(connection, obj, instId, type);
xSemaphoreGiveRecursive(connection->lock);
return 0;
}
@ -609,7 +609,7 @@ static int32_t receiveObject(UAVTalkConnectionData *connection, uint8_t type, ui
// Process message type
switch (type) {
case UAVTALK_TYPE_OBJ:
case UAVTALK_TYPE_OBJ | UAVTALK_TYPE_OBJ_TS:
// All instances, not allowed for OBJ messages
if (obj && (instId != UAVOBJ_ALL_INSTANCES))
{
@ -623,7 +623,7 @@ static int32_t receiveObject(UAVTalkConnectionData *connection, uint8_t type, ui
ret = -1;
}
break;
case UAVTALK_TYPE_OBJ_ACK:
case UAVTALK_TYPE_OBJ_ACK | UAVTALK_TYPE_OBJ_ACK_TS:
// All instances, not allowed for OBJ_ACK messages
if (obj && (instId != UAVOBJ_ALL_INSTANCES))
{
@ -708,7 +708,7 @@ static int32_t sendObject(UAVTalkConnectionData *connection, UAVObjHandle obj, u
}
// Process message type
if ( type == UAVTALK_TYPE_OBJ || type == UAVTALK_TYPE_OBJ_ACK )
if ( type == UAVTALK_TYPE_OBJ || type == UAVTALK_TYPE_OBJ_TS || type == UAVTALK_TYPE_OBJ_ACK || type == UAVTALK_TYPE_OBJ_ACK_TS )
{
if (instId == UAVOBJ_ALL_INSTANCES)
{