2022-03-03 12:48:56 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
#include "environment.h"
|
|
|
|
#include "protocols/base.h"
|
|
|
|
|
2022-09-14 19:11:38 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
typedef struct SubGhzTransmitter SubGhzTransmitter;
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Allocate and init SubGhzTransmitter.
|
|
|
|
* @param environment Pointer to a SubGhzEnvironment instance
|
|
|
|
* @return SubGhzTransmitter* pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTransmitter*
|
|
|
|
subghz_transmitter_alloc_init(SubGhzEnvironment* environment, const char* protocol_name);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Free SubGhzTransmitter.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_transmitter_free(SubGhzTransmitter* instance);
|
|
|
|
|
2022-05-08 20:50:20 +03:00
|
|
|
/** Get protocol instance.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
|
|
|
SubGhzProtocolEncoderBase* subghz_transmitter_get_protocol_instance(SubGhzTransmitter* instance);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Forced transmission stop.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
*/
|
2022-03-03 12:48:56 +03:00
|
|
|
bool subghz_transmitter_stop(SubGhzTransmitter* instance);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Deserialize and generating an upload to send.
|
|
|
|
* @param instance Pointer to a SubGhzTransmitter instance
|
|
|
|
* @param flipper_format Pointer to a FlipperFormat instance
|
2023-03-03 18:09:13 +03:00
|
|
|
* @return status
|
2022-03-16 12:18:48 +03:00
|
|
|
*/
|
2023-03-03 18:09:13 +03:00
|
|
|
SubGhzProtocolStatus
|
|
|
|
subghz_transmitter_deserialize(SubGhzTransmitter* instance, FlipperFormat* flipper_format);
|
2022-03-03 12:48:56 +03:00
|
|
|
|
2022-03-16 12:18:48 +03: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 12:48:56 +03:00
|
|
|
LevelDuration subghz_transmitter_yield(void* context);
|
2022-09-14 19:11:38 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|