mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-06 18:51:53 -07:00
Merge remote-tracking branch 'ofw/dev' into mntm-dev
This commit is contained in:
@@ -242,6 +242,7 @@ Header,+,lib/toolbox/manchester_encoder.h,,
|
||||
Header,+,lib/toolbox/md5_calc.h,,
|
||||
Header,+,lib/toolbox/name_generator.h,,
|
||||
Header,+,lib/toolbox/path.h,,
|
||||
Header,+,lib/toolbox/pipe.h,,
|
||||
Header,+,lib/toolbox/pretty_format.h,,
|
||||
Header,+,lib/toolbox/protocols/protocol_dict.h,,
|
||||
Header,+,lib/toolbox/pulse_protocols/pulse_glue.h,,
|
||||
@@ -461,11 +462,16 @@ Function,-,__utoa,char*,"unsigned, char*, int"
|
||||
Function,+,__wrap___assert,void,"const char*, int, const char*"
|
||||
Function,+,__wrap___assert_func,void,"const char*, int, const char*, const char*"
|
||||
Function,+,__wrap_fflush,int,FILE*
|
||||
Function,+,__wrap_fgetc,int,FILE*
|
||||
Function,+,__wrap_fgets,char*,"char*, size_t, FILE*"
|
||||
Function,+,__wrap_getc,int,FILE*
|
||||
Function,+,__wrap_getchar,int,
|
||||
Function,+,__wrap_printf,int,"const char*, ..."
|
||||
Function,+,__wrap_putc,int,"int, FILE*"
|
||||
Function,+,__wrap_putchar,int,int
|
||||
Function,+,__wrap_puts,int,const char*
|
||||
Function,+,__wrap_snprintf,int,"char*, size_t, const char*, ..."
|
||||
Function,+,__wrap_ungetc,int,"int, FILE*"
|
||||
Function,+,__wrap_vsnprintf,int,"char*, size_t, const char*, va_list"
|
||||
Function,-,_asiprintf_r,int,"_reent*, char**, const char*, ..."
|
||||
Function,-,_asniprintf_r,char*,"_reent*, char*, size_t*, const char*, ..."
|
||||
@@ -1209,6 +1215,7 @@ Function,+,flipper_format_update_uint32,_Bool,"FlipperFormat*, const char*, cons
|
||||
Function,+,flipper_format_write_bool,_Bool,"FlipperFormat*, const char*, const _Bool*, const uint16_t"
|
||||
Function,+,flipper_format_write_comment,_Bool,"FlipperFormat*, FuriString*"
|
||||
Function,+,flipper_format_write_comment_cstr,_Bool,"FlipperFormat*, const char*"
|
||||
Function,+,flipper_format_write_empty_line,_Bool,FlipperFormat*
|
||||
Function,+,flipper_format_write_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
|
||||
Function,+,flipper_format_write_header,_Bool,"FlipperFormat*, FuriString*, const uint32_t"
|
||||
Function,+,flipper_format_write_header_cstr,_Bool,"FlipperFormat*, const char*, const uint32_t"
|
||||
@@ -1856,6 +1863,7 @@ Function,+,furi_stream_buffer_receive,size_t,"FuriStreamBuffer*, void*, size_t,
|
||||
Function,+,furi_stream_buffer_reset,FuriStatus,FuriStreamBuffer*
|
||||
Function,+,furi_stream_buffer_send,size_t,"FuriStreamBuffer*, const void*, size_t, uint32_t"
|
||||
Function,+,furi_stream_buffer_spaces_available,size_t,FuriStreamBuffer*
|
||||
Function,+,furi_stream_get_trigger_level,size_t,FuriStreamBuffer*
|
||||
Function,+,furi_stream_set_trigger_level,_Bool,"FuriStreamBuffer*, size_t"
|
||||
Function,+,furi_string_alloc,FuriString*,
|
||||
Function,+,furi_string_alloc_move,FuriString*,FuriString*
|
||||
@@ -1936,6 +1944,7 @@ Function,+,furi_thread_get_return_code,int32_t,FuriThread*
|
||||
Function,+,furi_thread_get_signal_callback,FuriThreadSignalCallback,const FuriThread*
|
||||
Function,+,furi_thread_get_stack_space,uint32_t,FuriThreadId
|
||||
Function,+,furi_thread_get_state,FuriThreadState,FuriThread*
|
||||
Function,+,furi_thread_get_stdin_callback,FuriThreadStdinReadCallback,
|
||||
Function,+,furi_thread_get_stdout_callback,FuriThreadStdoutWriteCallback,
|
||||
Function,+,furi_thread_is_suspended,_Bool,FuriThreadId
|
||||
Function,+,furi_thread_join,_Bool,FuriThread*
|
||||
@@ -1956,9 +1965,12 @@ Function,+,furi_thread_set_signal_callback,void,"FuriThread*, FuriThreadSignalCa
|
||||
Function,+,furi_thread_set_stack_size,void,"FuriThread*, size_t"
|
||||
Function,+,furi_thread_set_state_callback,void,"FuriThread*, FuriThreadStateCallback"
|
||||
Function,+,furi_thread_set_state_context,void,"FuriThread*, void*"
|
||||
Function,+,furi_thread_set_stdout_callback,void,FuriThreadStdoutWriteCallback
|
||||
Function,+,furi_thread_set_stdin_callback,void,"FuriThreadStdinReadCallback, void*"
|
||||
Function,+,furi_thread_set_stdout_callback,void,"FuriThreadStdoutWriteCallback, void*"
|
||||
Function,+,furi_thread_signal,_Bool,"const FuriThread*, uint32_t, void*"
|
||||
Function,+,furi_thread_start,void,FuriThread*
|
||||
Function,+,furi_thread_stdin_read,size_t,"char*, size_t, FuriWait"
|
||||
Function,+,furi_thread_stdin_unread,void,"char*, size_t"
|
||||
Function,+,furi_thread_stdout_flush,int32_t,
|
||||
Function,+,furi_thread_stdout_write,size_t,"const char*, size_t"
|
||||
Function,+,furi_thread_suspend,void,FuriThreadId
|
||||
@@ -2994,6 +3006,22 @@ Function,+,pb_skip_field,_Bool,"pb_istream_t*, pb_wire_type_t"
|
||||
Function,+,pb_write,_Bool,"pb_ostream_t*, const pb_byte_t*, size_t"
|
||||
Function,-,pclose,int,FILE*
|
||||
Function,-,perror,void,const char*
|
||||
Function,+,pipe_alloc,PipeSideBundle,"size_t, size_t"
|
||||
Function,+,pipe_alloc_ex,PipeSideBundle,"PipeSideReceiveSettings, PipeSideReceiveSettings"
|
||||
Function,+,pipe_attach_to_event_loop,void,"PipeSide*, FuriEventLoop*"
|
||||
Function,+,pipe_bytes_available,size_t,PipeSide*
|
||||
Function,+,pipe_detach_from_event_loop,void,PipeSide*
|
||||
Function,+,pipe_free,void,PipeSide*
|
||||
Function,+,pipe_install_as_stdio,void,PipeSide*
|
||||
Function,+,pipe_receive,size_t,"PipeSide*, void*, size_t, FuriWait"
|
||||
Function,+,pipe_role,PipeRole,PipeSide*
|
||||
Function,+,pipe_send,size_t,"PipeSide*, const void*, size_t, FuriWait"
|
||||
Function,+,pipe_set_callback_context,void,"PipeSide*, void*"
|
||||
Function,+,pipe_set_data_arrived_callback,void,"PipeSide*, PipeSideDataArrivedCallback, FuriEventLoopEvent"
|
||||
Function,+,pipe_set_broken_callback,void,"PipeSide*, PipeSideBrokenCallback, FuriEventLoopEvent"
|
||||
Function,+,pipe_set_space_freed_callback,void,"PipeSide*, PipeSideSpaceFreedCallback, FuriEventLoopEvent"
|
||||
Function,+,pipe_spaces_available,size_t,PipeSide*
|
||||
Function,+,pipe_state,PipeState,PipeSide*
|
||||
Function,+,plugin_manager_alloc,PluginManager*,"const char*, uint32_t, const ElfApiInterface*"
|
||||
Function,+,plugin_manager_free,void,PluginManager*
|
||||
Function,+,plugin_manager_get,const FlipperAppPluginDescriptor*,"PluginManager*, uint32_t"
|
||||
|
||||
|
@@ -7,6 +7,12 @@
|
||||
|
||||
#define GATT_MIN_READ_KEY_SIZE (10)
|
||||
|
||||
#ifdef BLE_GATT_STRICT
|
||||
#define ble_gatt_strict_crash(message) furi_crash(message)
|
||||
#else
|
||||
#define ble_gatt_strict_crash(message)
|
||||
#endif
|
||||
|
||||
void ble_gatt_characteristic_init(
|
||||
uint16_t svc_handle,
|
||||
const BleGattCharacteristicParams* char_descriptor,
|
||||
@@ -42,6 +48,7 @@ void ble_gatt_characteristic_init(
|
||||
&char_instance->handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add %s char: %d", char_descriptor->name, status);
|
||||
ble_gatt_strict_crash("Failed to add characteristic");
|
||||
}
|
||||
|
||||
char_instance->descriptor_handle = 0;
|
||||
@@ -68,6 +75,7 @@ void ble_gatt_characteristic_init(
|
||||
&char_instance->descriptor_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add %s char descriptor: %d", char_descriptor->name, status);
|
||||
ble_gatt_strict_crash("Failed to add characteristic descriptor");
|
||||
}
|
||||
if(release_data) {
|
||||
free((void*)char_data);
|
||||
@@ -82,6 +90,7 @@ void ble_gatt_characteristic_delete(
|
||||
if(status) {
|
||||
FURI_LOG_E(
|
||||
TAG, "Failed to delete %s char: %d", char_instance->characteristic->name, status);
|
||||
ble_gatt_strict_crash("Failed to delete characteristic");
|
||||
}
|
||||
free((void*)char_instance->characteristic);
|
||||
}
|
||||
@@ -111,14 +120,27 @@ bool ble_gatt_characteristic_update(
|
||||
release_data = char_descriptor->data.callback.fn(context, &char_data, &char_data_size);
|
||||
}
|
||||
|
||||
tBleStatus result = aci_gatt_update_char_value(
|
||||
svc_handle, char_instance->handle, 0, char_data_size, char_data);
|
||||
if(result) {
|
||||
FURI_LOG_E(TAG, "Failed updating %s characteristic: %d", char_descriptor->name, result);
|
||||
}
|
||||
tBleStatus result;
|
||||
size_t retries_left = 1000;
|
||||
do {
|
||||
retries_left--;
|
||||
result = aci_gatt_update_char_value(
|
||||
svc_handle, char_instance->handle, 0, char_data_size, char_data);
|
||||
if(result == BLE_STATUS_INSUFFICIENT_RESOURCES) {
|
||||
FURI_LOG_W(TAG, "Insufficient resources for %s characteristic", char_descriptor->name);
|
||||
furi_delay_ms(1);
|
||||
}
|
||||
} while(result == BLE_STATUS_INSUFFICIENT_RESOURCES && retries_left);
|
||||
|
||||
if(release_data) {
|
||||
free((void*)char_data);
|
||||
}
|
||||
|
||||
if(result != BLE_STATUS_SUCCESS) {
|
||||
FURI_LOG_E(TAG, "Failed updating %s characteristic: %d", char_descriptor->name, result);
|
||||
ble_gatt_strict_crash("Failed to update characteristic");
|
||||
}
|
||||
|
||||
return result != BLE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -132,6 +154,7 @@ bool ble_gatt_service_add(
|
||||
Service_UUID_Type, Service_UUID, Service_Type, Max_Attribute_Records, Service_Handle);
|
||||
if(result) {
|
||||
FURI_LOG_E(TAG, "Failed to add service: %x", result);
|
||||
ble_gatt_strict_crash("Failed to add service");
|
||||
}
|
||||
|
||||
return result == BLE_STATUS_SUCCESS;
|
||||
@@ -141,6 +164,7 @@ bool ble_gatt_service_delete(uint16_t svc_handle) {
|
||||
tBleStatus result = aci_gatt_del_service(svc_handle);
|
||||
if(result) {
|
||||
FURI_LOG_E(TAG, "Failed to delete service: %x", result);
|
||||
ble_gatt_strict_crash("Failed to delete service");
|
||||
}
|
||||
|
||||
return result == BLE_STATUS_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user