Printing lisible data
This commit is contained in:
parent
400be84aa0
commit
96013a465c
|
@ -27,10 +27,14 @@ static void __not_in_flash_func(udp_receive_callback)(void *arg, struct udp_pcb
|
||||||
// Default callback func
|
// Default callback func
|
||||||
static void __not_in_flash_func(default_message_callback)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port)
|
static void __not_in_flash_func(default_message_callback)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port)
|
||||||
{
|
{
|
||||||
printf("Received: len=%d from %s:%d\n", len, ipaddr_ntoa(addr), port);
|
//printf("Received: len=%d from %s:%d\n", len, ipaddr_ntoa(addr), port);
|
||||||
|
|
||||||
for(uint i = 0; i < len; i++) printf("payload[%d]=%d | ", i, payload[i]);
|
//for(uint i = 0; i < len; i++) printf("payload[%d]=%d | ", i, payload[i]);
|
||||||
puts("\n");
|
//puts("\n");
|
||||||
|
|
||||||
|
printf(">Robot angle : %d\n", (int16_t)((payload[UDP_PAYLOAD_ANGLE_H_BYTE] << 8) | payload[UDP_PAYLOAD_ANGLE_L_BYTE]));
|
||||||
|
printf(">Robot x speed : %d\n", (int8_t)payload[UDP_PAYLOAD_X_AXIS_SPEED_BYTE]);
|
||||||
|
printf(">Robot y speed : %d\n", (int8_t)payload[UDP_PAYLOAD_Y_AXIS_SPEED_BYTE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void udp_client_init(void)
|
void udp_client_init(void)
|
||||||
|
|
Loading…
Reference in New Issue