#include <stdint.h>
#include <string.h>
#include <glib.h>
-#include <dbus/dbus-glib.h>
-
#include "bluetooth-api.h"
GMainLoop *main_loop = NULL;
-typedef struct
-{
+typedef struct {
const char *tc_name;
int tc_code;
} tc_table_t;
-tc_table_t tc_table[] =
-{
+tc_table_t tc_table[] = {
{"Send alert to remote le device" , 1},
{"Set Link loss alert" , 2},
};
#define tc_result(success, tc_index) \
- TC_PRT("Test case [%d - %s] %s", tc_table[tc_index].tc_code, tc_table[tc_index].tc_name, ((success == TC_PASS)?"Success":"Failed"));
+ TC_PRT("Test case [%d - %s] %s", tc_table[tc_index].tc_code, tc_table[tc_index].tc_name, ((success == TC_PASS) ? "Success" : "Failed"));
char *g_alert_char_handle = NULL;
guint8 g_alert_level = 0;
}
buf = g_malloc0(20);
- /* Fix : NULL_RETURNS */
- if (buf == NULL) {
- close(fd);
- return NULL;
- }
if (read(fd, buf, 17) < 17) {
perror("Can't load firmware");
addr = get_bd_from_file(BD_ADDR_FILE);
if (addr) {
- TC_PRT("Remote bd adress from file: %s", addr);
+ TC_PRT("Remote bd address from file: %s", addr);
convert_addr_string_to_addr_type(device_address, addr);
g_free(addr);
return;
void cleanup()
{
TC_PRT("bluetooth framework TC cleanup");
- if ( main_loop != NULL)
+ if (main_loop != NULL)
g_main_loop_unref(main_loop);
}
{
TC_PRT(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
TC_PRT("bt event callback 0x%04x", event);
- switch(event) {
+ switch (event) {
case BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID:
{
TC_PRT("BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID");
unsigned int len = 0;
int test_id;
- if (g_io_channel_read_chars(chan, buf, sizeof(buf),
+ if (g_io_channel_read_chars(chan, buf, sizeof(buf),
&len, NULL) == G_IO_STATUS_ERROR) {
printf("IO Channel read error");
return FALSE;
}
- printf("%s\n",buf);
+ printf("%s\n", buf);
tc_usage_print();
test_id = atoi(buf);