页次: 1
连上之后是噪音的原来是程序就是发随机数。
static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len)
{
if (len < 0 || data == NULL) {
return 0;
}
// generate random sequence
int val = rand() % (1 << 16);
for (int i = 0; i < (len >> 1); i++) {
data[(i << 1)] = val & 0xff;
data[(i << 1) + 1] = (val >> 8) & 0xff;
}
return len;
}
页次: 1