You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
954 B

/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
/****************************************************************************
*
* This file is for ble spp client demo.
*
****************************************************************************/
#include "ble_spp_client_demo.h"
#include "key.h"
void motor_drive_hex_to_str(char *hex, int hex_len, char *str);
void app_main(void)
{
ble_init();
key_init();
key_ble_send_cmd_reg(ble_key_cb);
while (true)
{
key_schedule();
}
}
void motor_drive_hex_to_str(char *hex, int hex_len, char *str)
{
int i, pos = 0;
for (i = (hex_len - 1); i >= 0; i--)
{
sprintf(str + pos, "%02x", hex[i]);
pos += 2;
}
}