Project

General

Profile

Revision 350

increased precision

View differences:

hltp.c
55 55
}
56 56
int hltp_send_host_info(const host_info_t *p) { printf("%s, %d\n",__func__, rand());
57 57

  
58
    printf("    sending angle: 0x%04X\n", p->host_angle);
58
    //printf("    sending angle: 0x%04X\n", p->host_angle);
59 59

  
60 60
    uint8_t type = hltp_type_host;
61 61
    const uint8_t* ptr[11]; size_t sz[11];
62 62
    ptr[0]  = (uint8_t*)&   type                  ;     sz[0]   = 1;
63 63
    ptr[1]  = (uint8_t*)&p->host_x                ;     sz[1]   = sizeof(int16_t);
64 64
    ptr[2]  = (uint8_t*)&p->host_y                ;     sz[2]   = sizeof(int16_t);
65
    ptr[3]  = (uint8_t*)&p->host_angle            ;     sz[3]   = sizeof(int16_t);
65
    ptr[3]  = (uint8_t*)&p->host_angle            ;     sz[3]   = sizeof(float);
66 66
    ptr[4]  = (uint8_t*)&p->host_health           ;     sz[4]   = sizeof(int16_t);
67 67
    ptr[5]  = (uint8_t*)&p->host_current_health   ;     sz[5]   = sizeof(int16_t);
68 68
    ptr[6]  = (uint8_t*)&p->remote_x              ;     sz[6]   = sizeof(int16_t);
69 69
    ptr[7]  = (uint8_t*)&p->remote_y              ;     sz[7]   = sizeof(int16_t);
70
    ptr[8]  = (uint8_t*)&p->remote_angle          ;     sz[8]   = sizeof(int16_t);
70
    ptr[8]  = (uint8_t*)&p->remote_angle          ;     sz[8]   = sizeof(float);
71 71
    ptr[9]  = (uint8_t*)&p->remote_health         ;     sz[9]   = sizeof(int16_t);
72 72
    ptr[10] = (uint8_t*)&p->remote_current_health ;     sz[10]  = sizeof(int16_t);
73 73
    /*

Also available in: Unified diff