Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otRFCom Class Reference
[RFCOM - Wireless Serial Transceiver Module library, RFCOM - Wireless Serial Transceiver Module library]

Wireless Serial Transceiver Module library. More...

#include <otRFCom.h>


Public Types

enum  Baud {
  B_2400, B_4800, B_9600, B_14400,
  B_19200, B_38400, B_57600, B_115200,
  B_128000, B_256000
}
enum  TransmitPower {
  P_13dBm, P_10dBm, P_8dBm, P_7dBm,
  P_5dBm, P_4dBm, P_2dBm, P_0dBm,
  M_3dBm, M_6dBm, M_10dBm, M_18dBm,
  M_30dBm
}

Public Member Functions

 otRFCom ()
void init (U8 uart, U8 portId, U8 bit)
void reset ()
void apply ()
bool setBaud (U16 baud)
bool setFrequency (U16 MHz)
bool setRetry (U8 retry)
bool setTxId (U8 id4, U8 id3, U8 id2, U8 id1, U8 id0)
bool setRxId (U8 id4, U8 id3, U8 id2, U8 id1, U8 id0)
bool setTxPower (U8 power)


Detailed Description


Member Enumeration Documentation

enum otRFCom::Baud
 

Enumeration values:
B_2400  Set baud rate at 2400.
B_4800  Set baud rate at 4800.
B_9600  Set baud rate at 9600.
B_14400  Set baud rate at 14400.
B_19200  Set baud rate at 19200.
B_38400  Set baud rate at 38400.
B_57600  Set baud rate at 57600.
B_115200  Set baud rate at 115200.
B_128000  Set baud rate at 128000.
B_256000  Set baud rate at 256000.

enum otRFCom::TransmitPower
 

Enumeration values:
P_13dBm  Transmission power is set to +13dBm.
P_10dBm  Transmission power is set to +10dBm.
P_8dBm  Transmission power is set to +8dBm.
P_7dBm  Transmission power is set to +7dBm.
P_5dBm  Transmission power is set to +5dBm.
P_4dBm  Transmission power is set to +4dBm.
P_2dBm  Transmission power is set to +2dBm.
P_0dBm  Transmission power is set to +0dBm.
M_3dBm  Transmission power is set to -3dBm.
M_6dBm  Transmission power is set to -6dBm.
M_10dBm  Transmission power is set to -10dBm.
M_18dBm  Transmission power is set to -18dBm.
M_30dBm  Transmission power is set to -30dBm.


Constructor & Destructor Documentation

otRFCom.otRFCom (   ) 
 

Create the class


Member Function Documentation

void otRFCom.apply (   ) 
 

After the RF-COM settings is completed call this function and the interface is ready to send/receive data according your settings.

void otRFCom.init (  U8  uart,
U8  portId,
U8  bit
) 
 

Init the RF-COM interface and the related port for the control of CMD signal

Parameters:
uart Uart channel see UartId
portId Port identifier see PortId
bit Used bit of the suggested port for the control of CMD signal

void otRFCom.reset (   ) 
 

Reset the RF-COM interface restoring defaults:
BAUD = 9600bps
FREQ = 2478MHz
TID = 0x5555555555
RID = 0x5555555555
RETRY = 0x0A
POWER = 0(+13dBm)

bool otRFCom.setBaud (  U16  baud  ) 
 

Set the baud rate.

Parameters:
baud Baud rate used for RF receive/transmit, see Baud
Returns:
true on success
        rfcom.setBaud(otRFCom::B_115200);

bool otRFCom.setFrequency (  U16  MHz  ) 
 

Set Frequency.
Note: WiFi frequencys are: 2412,2417,2422,2407,2432,2437,2442,2452,2457,2462,2467,2472,2484. If WiFi is present we do not use these frequencies!

Parameters:
MHz Used frequency, accepted range from 2400 to 2527 (MHz).
Returns:
true on success
        rfcom.setFrequency(2500);

bool otRFCom.setRetry (  U8  retry  ) 
 

Set the number of repeated transmission of data per frame, set the higher, the more reliable data transmission, but the data will be delayed longer. When you use it as a remote control, try to set a larger value to ensure reliability. When module sends data successfully, it does not resend again, even if it is set to 10 times in the transmission process, it may only transfer 3 times succeeded. The retransmissions is the maximum number of retransmissions after a failed transmission.

Parameters:
retry Number of retry, accepted range is 2 to 15
Returns:
true on success

bool otRFCom.setRxId (  U8  id4,
U8  id3,
U8  id2,
U8  id1,
U8  id0
) 
 

Same of setTxId

Parameters:
id4 MSB
id3 4th
id2 3rd
id1 2nd
id0 LSB
Returns:
true on success

bool otRFCom.setTxId (  U8  id4,
U8  id3,
U8  id2,
U8  id1,
U8  id0
) 
 

The transmission ID is the identifier of the radio data. In the case of the same frequency, only when the transmission ID and reception ID are the same, then can communicate with each other. That is to say all the modules whose reception ID are the same with the transmission ID of one module can receive the data it sends at the same time. Transmission ID has a total of 5 bytes. The transmission ID and reception ID of the same module can be the same or different.

Parameters:
id4 MSB
id3 4th
id2 3rd
id1 2nd
id0 LSB
Returns:
true on success

bool otRFCom.setTxPower (  U8  power  ) 
 

This command can be set up to 14 kinds of transmission power, each transmission power, the module consumes the current is not the same, the greater the transmission power, the greater the current consumption, otherwise smaller.

Parameters:
power Transmission power, see TransmitPower
Returns:
true on success


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0