incomingHandler.py
Go to the documentation of this file.
00001 import struct
00002 
00003 __author__ = 'tom1231'
00004 
00005 CON_REQ = 1
00006 IMU_REQ = 11
00007 RELAY_REQ = 12
00008 OPEN_LOOP_REQ = 15
00009 RIG_REQ = 19
00010 PSET_REQ = 20
00011 
00012 SERVO_RES = 102
00013 ACK_RES = 105
00014 MOTOR_RES = 106
00015 CLOSE_DIFF_RES = 108
00016 URF_RES = 109
00017 SWITCH_RES = 110
00018 IMU_RES = 111
00019 GPS_RES = 113
00020 PPM_RES = 114
00021 BAT_RES = 116
00022 VER_RES = 118
00023 IMU_CLIB_RES = 121
00024 
00025 class IncomingHandler:
00026 
00027     def getIncomingHeaderId(self, data):
00028         return struct.unpack('<B', bytearray(data))[0]
00029 
00030     def getIncomingHeaderSizeAndId(self, data):
00031         id = self.getIncomingHeaderId(data)
00032         if id == CON_REQ: return 7, id
00033         if id == SERVO_RES: return 11, id
00034         if id == ACK_RES: return 8, id
00035         if id == MOTOR_RES: return 15, id
00036         if id == CLOSE_DIFF_RES: return 30, id
00037         if id == URF_RES: return 11, id
00038         if id == SWITCH_RES: return 8, id
00039         if id == IMU_RES: return 58, id
00040         if id == GPS_RES: return 23, id
00041         if id == PPM_RES: return 38, id
00042         if id == BAT_RES: return 10, id
00043         if id == IMU_CLIB_RES: return 18, id
00044         return 0, 0
00045 


ric_board
Author(s): RoboTiCan
autogenerated on Fri Oct 27 2017 03:02:30