Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 261 → Rev 262

/bioloid/packet-parser/packet-parser.c
43,6 → 43,7
 
OPT_HELP = 'h',
OPT_VERBOSE = 'v',
OPT_ID = 'i',
 
// Options from this point onwards don't have any short option equivalents
 
57,6 → 58,7
 
struct option gOption[] =
{
{ "id", required_argument, NULL, OPT_ID },
{ "verbose", no_argument, NULL, OPT_VERBOSE },
{ "version", no_argument, NULL, OPT_VERSION },
{ "help", no_argument, NULL, OPT_HELP },
63,8 → 65,9
{ NULL }
};
 
uint8_t gLastID = 0xFF;
uint8_t gExpectingStatus = 0;
uint8_t gLastID = 0xFF;
uint8_t gExpectingStatus = 0;
BLD_ID_t gId;
 
/* ---- Private Function Prototypes --------------------------------------- */
 
166,6 → 169,12
break;
}
 
case OPT_ID:
{
gId = strtoul( optarg, NULL, 0 );
break;
}
 
case OPT_VERBOSE:
{
gVerbose = TRUE;
208,6 → 217,8
lineNum = 0;
BLD_Init( &inst );
 
inst.m_id = gId;
inst.m_logPacket = gVerbose;
inst.m_pktRcvd = PacketReceived;
 
while ( fgets( line, sizeof( line ), fs ) != NULL )
225,7 → 236,7
 
// Skip leading spaces
 
while ( isspace( *s ))
while ( isspace( (int)*s ))
{
s++;
}
241,7 → 252,7
 
val = strtol( s, &endPtr, 16 );
 
if (( *endPtr != '\0' ) && !isspace( *endPtr ))
if (( *endPtr != '\0' ) && !isspace( (int)*endPtr ))
{
LogError( "Line %d: Invalid number detected: '%s'\n", lineNum, s );
break;
/bioloid/packet-parser/Sync-Write.txt
0,0 → 1,13
# Sync Write example - Set multiple positions and velocities
# Dynamixel actuator with an ID of 0: to position 0x010 with a speed of 0x150
# Dynamixel actuator with an ID of 1: to position 0x220 with a speed of 0x360
# Dynamixel actuator with an ID of 2: to position 0x030 with a speed of 0x170
# Dynamixel actuator with an ID of 0: to position 0x220 with a speed of 0x380
 
ff ff fe 18 83 1e 04
00 10 00 50 01
01 20 02 60 03
02 30 00 70 01
03 20 02 80 03
12
 
/bioloid/packet-parser/Test-Packets.txt
41,7 → 41,7
01 20 02 60 03
02 30 00 70 01
03 20 02 80 03
e2
12
 
FF FF FE 18 83 1E 04 00 10 00 50
01 01 20 02 60 03 02 30 00 70 01 03 20 02 80
/bioloid/packet-parser/Config.h
32,6 → 32,8
*/
 
#define CFG_LOG_TO_BUFFER 0
#define CFG_BLD_MAX_PARAM 128
#define CFG_BLD_OPTIMIZE_SYNC_WRITE_PARSING 1
 
#endif // CONFIG_H