Пример #1
0
int main( void )
{
	char str[] = "DEADBEEF";
	unsigned char *tmp;
	int i=0, res;

	bufferInit( &myBuff, serial_link, 256 );	
	stxetxInit( put_char );
	stxetxSend( 0, 0, strlen( str ), (unsigned char*) str );

	// Now parse the package byte by until the receive function claims success.
	printf( "\nStarting parsing" );
	res = stxetxProcess( &myBuff );		
#if 0
	do {
		res = stxetxProcess( &myBuff );
		printf( "." );
	} while ( res );
#endif
	printf( "\nFinnished parsing!\n" );

	tmp = stxetxGetRxPacketData();
	for ( i = 0; i < stxetxGetRxPacketDatalength(); i++ ) {
		printf( "%x ", *tmp ); // Show the received data
		tmp++; 
	}
	printf( "\n" );
	return 0;
}
Пример #2
0
void radioSend(u08 status, u08 type, u08 datalength, u08* dataptr)
{
	stxetxSend(status, type, datalength, dataptr);
}