2 ******************************************************************************
3 * @addtogroup OpenPilotSystem OpenPilot System
5 * @addtogroup OpenPilotLibraries OpenPilot System Libraries
8 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
9 * @brief Include file of the UAVTalk library
10 * @see The GNU Public License (GPL) Version 3
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 typedef int32_t (*UAVTalkOutputStream
)(uint8_t *data
, int32_t length
);
37 uint32_t txObjectBytes
;
42 uint32_t rxObjectBytes
;
45 uint32_t rxSyncErrors
;
49 typedef void *UAVTalkConnection
;
51 typedef enum { UAVTALK_STATE_ERROR
= 0, UAVTALK_STATE_SYNC
, UAVTALK_STATE_TYPE
, UAVTALK_STATE_SIZE
, UAVTALK_STATE_OBJID
, UAVTALK_STATE_INSTID
, UAVTALK_STATE_TIMESTAMP
, UAVTALK_STATE_DATA
, UAVTALK_STATE_CS
, UAVTALK_STATE_COMPLETE
} UAVTalkRxState
;
54 UAVTalkConnection
UAVTalkInitialize(UAVTalkOutputStream outputStream
);
55 int32_t UAVTalkSetOutputStream(UAVTalkConnection connection
, UAVTalkOutputStream outputStream
);
56 UAVTalkOutputStream
UAVTalkGetOutputStream(UAVTalkConnection connection
);
57 int32_t UAVTalkSendObject(UAVTalkConnection connection
, UAVObjHandle obj
, uint16_t instId
, uint8_t acked
, int32_t timeoutMs
);
58 int32_t UAVTalkSendObjectTimestamped(UAVTalkConnection connectionHandle
, UAVObjHandle obj
, uint16_t instId
, uint8_t acked
, int32_t timeoutMs
);
59 int32_t UAVTalkSendObjectRequest(UAVTalkConnection connection
, UAVObjHandle obj
, uint16_t instId
, int32_t timeoutMs
);
60 UAVTalkRxState
UAVTalkProcessInputStream(UAVTalkConnection connectionHandle
, uint8_t *rxbuffer
, uint8_t length
);
61 UAVTalkRxState
UAVTalkProcessInputStreamQuiet(UAVTalkConnection connectionHandle
, uint8_t *rxbuffer
, uint8_t length
, uint8_t *position
);
62 int32_t UAVTalkRelayPacket(UAVTalkConnection inConnectionHandle
, UAVTalkConnection outConnectionHandle
);
63 int32_t UAVTalkReceiveObject(UAVTalkConnection connectionHandle
);
64 void UAVTalkGetStats(UAVTalkConnection connection
, UAVTalkStats
*stats
, bool reset
);
65 void UAVTalkAddStats(UAVTalkConnection connection
, UAVTalkStats
*stats
, bool reset
);
66 void UAVTalkResetStats(UAVTalkConnection connection
);
67 void UAVTalkGetLastTimestamp(UAVTalkConnection connection
, uint16_t *timestamp
);
68 uint32_t UAVTalkGetPacketObjId(UAVTalkConnection connection
);