Chirp C SDK  3.3.1
Use Chirp to send data over sound from your C application.
chirp_sdk.h
Go to the documentation of this file.
1 
17 #ifndef CHIRP_SDK_H
18 #define CHIRP_SDK_H
19 
20 #include <stdbool.h>
21 #include <stdint.h>
22 
27 #if defined(__WIN32) || defined(_WIN32) || defined(WIN32)
28 #define PUBLIC_SYM __declspec(dllexport)
29 #else
30 #define PUBLIC_SYM __attribute__ ((visibility ("default")))
31 #endif
32 
33 #include "chirp_sdk_errors.h"
34 #include "chirp_sdk_events.h"
35 #include "chirp_sdk_version.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
44 typedef struct _chirp_sdk_t chirp_sdk_t;
45 
56 PUBLIC_SYM chirp_sdk_t *new_chirp_sdk(const char *key, const char *secret);
57 
69 
87 PUBLIC_SYM void chirp_sdk_free(void *ptr);
88 
102 
113 
126 
136 
147 
158 
169 PUBLIC_SYM float chirp_sdk_get_duration_for_payload_length(chirp_sdk_t *sdk, size_t payload_length);
170 
181 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_is_valid(chirp_sdk_t *sdk, const uint8_t *bytes, size_t length);
182 
196 PUBLIC_SYM uint8_t *chirp_sdk_random_payload(chirp_sdk_t *sdk, size_t *length);
197 
208 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_send(chirp_sdk_t *sdk, uint8_t *bytes, size_t length);
209 
221 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process(chirp_sdk_t *sdk, float *in, float *out, size_t length);
222 
232 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_input(chirp_sdk_t *sdk, float *buffer, size_t length);
233 
244 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_output(chirp_sdk_t *sdk, float *buffer, size_t length);
245 
257 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_shorts(chirp_sdk_t *sdk, short *in, short *out, size_t length);
258 
268 PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_shorts_input(chirp_sdk_t *sdk, const short *buffer, size_t length);
269 
281 
290 
301 
312 
322 
330 
340 
351 
359 
367 
378 
389 
404 
415 
427 
441 
449 
450 #ifdef __cplusplus
451 }
452 #endif
453 
454 #endif /* !CHIRP_SDK_H */
chirp_sdk_set_frequency_correction
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_frequency_correction(chirp_sdk_t *sdk, float correction)
chirp_sdk_version.h
Provides getter to the lib name, version and build number of the library.
chirp_sdk_get_state
PUBLIC_SYM chirp_sdk_state_t chirp_sdk_get_state(chirp_sdk_t *sdk)
chirp_sdk_get_input_sample_rate
PUBLIC_SYM uint32_t chirp_sdk_get_input_sample_rate(chirp_sdk_t *sdk)
chirp_sdk_get_output_sample_rate
PUBLIC_SYM uint32_t chirp_sdk_get_output_sample_rate(chirp_sdk_t *sdk)
chirp_sdk_state_t
chirp_sdk_state_t
Definition: chirp_sdk_events.h:30
chirp_sdk_set_volume
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_volume(chirp_sdk_t *sdk, float volume)
chirp_sdk_errors.h
Error handling of the SDK.
chirp_sdk_callback_set_t
Definition: chirp_sdk_events.h:76
chirp_sdk_get_heap_usage
PUBLIC_SYM int32_t chirp_sdk_get_heap_usage(chirp_sdk_t *sdk)
chirp_sdk_process_shorts_input
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_shorts_input(chirp_sdk_t *sdk, const short *buffer, size_t length)
chirp_sdk_t
struct _chirp_sdk_t chirp_sdk_t
Definition: chirp_sdk.h:44
chirp_sdk_set_callbacks
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_callbacks(chirp_sdk_t *sdk, chirp_sdk_callback_set_t callback_set)
chirp_sdk_stop
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_stop(chirp_sdk_t *sdk)
chirp_sdk_set_output_sample_rate
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_output_sample_rate(chirp_sdk_t *sdk, uint32_t sample_rate)
chirp_sdk_get_channel_count
PUBLIC_SYM uint8_t chirp_sdk_get_channel_count(chirp_sdk_t *sdk)
chirp_sdk_get_info
PUBLIC_SYM char * chirp_sdk_get_info(chirp_sdk_t *sdk)
chirp_sdk_is_valid
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_is_valid(chirp_sdk_t *sdk, const uint8_t *bytes, size_t length)
chirp_sdk_set_input_sample_rate
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_input_sample_rate(chirp_sdk_t *sdk, uint32_t sample_rate)
chirp_sdk_random_payload
PUBLIC_SYM uint8_t * chirp_sdk_random_payload(chirp_sdk_t *sdk, size_t *length)
del_chirp_sdk
PUBLIC_SYM chirp_sdk_error_code_t del_chirp_sdk(chirp_sdk_t **sdk)
chirp_sdk_start
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_start(chirp_sdk_t *sdk)
chirp_sdk_get_max_payload_length
PUBLIC_SYM size_t chirp_sdk_get_max_payload_length(chirp_sdk_t *sdk)
chirp_sdk_set_config
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_config(chirp_sdk_t *sdk, const char *config)
new_chirp_sdk
PUBLIC_SYM chirp_sdk_t * new_chirp_sdk(const char *key, const char *secret)
chirp_sdk_error_code_t
chirp_sdk_error_code_t
Definition: chirp_sdk_errors.h:28
chirp_sdk_process_shorts_output
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_shorts_output(chirp_sdk_t *sdk, short *buffer, size_t length)
chirp_sdk_get_state_for_channel
PUBLIC_SYM chirp_sdk_state_t chirp_sdk_get_state_for_channel(chirp_sdk_t *sdk, uint8_t channel)
chirp_sdk_process_shorts
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_shorts(chirp_sdk_t *sdk, short *in, short *out, size_t length)
chirp_sdk_get_listen_to_self
PUBLIC_SYM bool chirp_sdk_get_listen_to_self(chirp_sdk_t *sdk)
chirp_sdk_set_transmission_channel
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_transmission_channel(chirp_sdk_t *sdk, uint8_t channel)
chirp_sdk_process
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process(chirp_sdk_t *sdk, float *in, float *out, size_t length)
chirp_sdk_process_output
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_output(chirp_sdk_t *sdk, float *buffer, size_t length)
chirp_sdk_get_volume
PUBLIC_SYM float chirp_sdk_get_volume(chirp_sdk_t *sdk)
chirp_sdk_get_duration_for_payload_length
PUBLIC_SYM float chirp_sdk_get_duration_for_payload_length(chirp_sdk_t *sdk, size_t payload_length)
chirp_sdk_set_callback_ptr
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_callback_ptr(chirp_sdk_t *sdk, void *ptr)
PUBLIC_SYM
#define PUBLIC_SYM
Definition: chirp_sdk.h:30
chirp_sdk_send
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_send(chirp_sdk_t *sdk, uint8_t *bytes, size_t length)
chirp_sdk_set_listen_to_self
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_set_listen_to_self(chirp_sdk_t *sdk, bool listen_to_self)
chirp_sdk_get_transmission_channel
PUBLIC_SYM int8_t chirp_sdk_get_transmission_channel(chirp_sdk_t *sdk)
chirp_sdk_free
PUBLIC_SYM void chirp_sdk_free(void *ptr)
chirp_sdk_events.h
Events implementations of the C SDK (callbacks and states).
chirp_sdk_process_input
PUBLIC_SYM chirp_sdk_error_code_t chirp_sdk_process_input(chirp_sdk_t *sdk, float *buffer, size_t length)