The error-code represents the result of a connection/disconnection
procedure and can be useful when a state transition is detected.
struct btd_profile *profile;
void *user_data;
btd_service_state_t state;
+ int err;
};
static const char *state2str(btd_service_state_t state)
assert(service->profile != NULL);
service->state = state;
+ service->err = err;
ba2str(device_get_address(service->device), addr);
DBG("%p: device %s profile %s state changed: %s -> %s (%d)", service,
return service->state;
}
+int btd_service_get_error(const struct btd_service *service)
+{
+ return service->err;
+}
+
void btd_service_connecting_complete(struct btd_service *service, int err)
{
if (service->state != BTD_SERVICE_STATE_DISCONNECTED &&
struct btd_device *btd_service_get_device(const struct btd_service *service);
struct btd_profile *btd_service_get_profile(const struct btd_service *service);
btd_service_state_t btd_service_get_state(const struct btd_service *service);
+int btd_service_get_error(const struct btd_service *service);
/* Functions used by profile implementation */
void btd_service_connecting_complete(struct btd_service *service, int err);