Skip to content

compilation issue #289

@1vijayvanga

Description

@1vijayvanga

while compiling the code it shows
async_gatt.c:42:24: error: unknown type name ‘gatt_connection_t’; did you mean ‘gatt_connect_cb_t’?
42 | static void connect_cb(gatt_connection_t* connection) {
| ^~~~~~~~~~~~~~~~~
| gatt_connect_cb_t
async_gatt.c: In function ‘main’:
async_gatt.c:64:9: error: unknown type name ‘gatt_connection_t’; did you mean ‘gatt_connect_cb_t’?
64 | gatt_connection_t* connection;
| ^~~~~~~~~~~~~~~~~
| gatt_connect_cb_t
async_gatt.c:96:30: warning: implicit declaration of function ‘gattlib_connect_async’; did you mean ‘gattlib_connect’? [-Wimplicit-function-declaration]
96 | connection = gattlib_connect_async(NULL, argv[1], BDADDR_LE_RANDOM, BT_SEC_LOW, 0, 0, connect_cb);
| ^~~~~~~~~~~~~~~~~~~~~
| gattlib_connect
async_gatt.c:96:85: error: ‘BT_SEC_LOW’ undeclared (first use in this function)
96 | connection = gattlib_connect_async(NULL, argv[1], BDADDR_LE_RANDOM, BT_SEC_LOW, 0, 0, connect_cb);
| ^~~~~~~~~~
async_gatt.c:96:85: note: each undeclared identifier is reported only once for each function it appears in
async_gatt.c:96:103: error: ‘connect_cb’ undeclared (first use in this function); did you mean ‘connection’?
96 | connection = gattlib_connect_async(NULL, argv[1], BDADDR_LE_RANDOM, BT_SEC_LOW, 0, 0, connect_cb);
| ^~~~~~~~~~
| connection
async_gatt.c:102:44: warning: passing argument 1 of ‘gattlib_disconnect’ from incompatible pointer type [-Wincompatible-pointer-types]
102 | gattlib_disconnect(connection);
| ^~~~~~~~~~
| |
| int *
In file included from async_gatt.c:29:
/usr/local/include/gattlib.h:385:46: note: expected ‘gattlib_connection_t *’ {aka ‘struct _gattlib_connection ’} but argument is of type ‘int
385 | int gattlib_disconnect(gattlib_connection_t
connection, bool wait_disconnection);
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
async_gatt.c:102:25: error: too few arguments to function ‘gattlib_disconnect’
102 | gattlib_disconnect(connection);
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/gattlib.h:385:5: note: declared here
385 | int gattlib_disconnect(gattlib_connection_t
connection, bool wait_disconnection);
| ^~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions