2022-03-03 09:48:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
#include "environment.h"
|
|
|
|
#include "protocols/base.h"
|
|
|
|
|
2022-09-14 16:11:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-03-03 09:48:56 +00:00
|
|
|
typedef struct SubGhzTransmitter SubGhzTransmitter;
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Allocate and init SubGhzTransmitter.
|
|
|
|
* @param environment Pointer to a SubGhzEnvironment instance
|
|
|
|
* @return SubGhzTransmitter* pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
SubGhzTransmitter*
|
|
|
|
subghz_transmitter_alloc_init(SubGhzEnvironment* environment, const char* protocol_name);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Free SubGhzTransmitter.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
void subghz_transmitter_free(SubGhzTransmitter* instance);
|
|
|
|
|
2022-05-08 17:50:20 +00:00
|
|
|
/** Get protocol instance.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
|
|
|
SubGhzProtocolEncoderBase* subghz_transmitter_get_protocol_instance(SubGhzTransmitter* instance);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Forced transmission stop.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
bool subghz_transmitter_stop(SubGhzTransmitter* instance);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Deserialize and generating an upload to send.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
|
|
|
* @return true On success
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
bool subghz_transmitter_deserialize(SubGhzTransmitter* instance, FlipperFormat* flipper_format);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Getting the level and duration of the upload to be loaded into DMA.
|
|
|
|
* @param context Pointer to a SubGhzTransmitter instance
|
|
|
|
* @return LevelDuration
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
LevelDuration subghz_transmitter_yield(void* context);
|
2022-09-14 16:11:38 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|