12. API - RF Module
12.1. Regular Classes
The following classes are intended for general use with the devices they represent. All classes in this section are concrete (not abstract).
12.1.1. RFM
- class lannerpsp.RFM(check_platform: bool = False)[source]
Radio Frequency Module.
- Parameters:
check_platform (bool) – Set to
True
to check if the platform supports this feature. Defaults toFalse
for better compatibility.- Raises:
PSPNotSupport – This function is not supported (when
check_platform
is set toTrue
).NotImplementedError – It has not been verified to run on this platform (when
check_platform
is set toTrue
).
- get_power_status() int [source]
Get module power status.
bit 0 means M.2 module, bit 1 means mPCIe module
0: power off, 1: power on
0 (00): mPCIe -> off, M.2 -> off
1 (01): mPCIe -> off, M.2 -> on
2 (10): mPCIe -> on, M.2 -> off
3 (11): mPCIe -> on, M.2 -> on
Example:
>>> rfm = RFM() >>> power_status = rfm.get_power_status() 3
- set_power_status(value: int) None [source]
Set module power status.
bit 0 means M.2 module, bit 1 means mPCIe module
0: power off, 1: power on
0 (00): mPCIe -> off, M.2 -> off
1 (01): mPCIe -> off, M.2 -> on
2 (10): mPCIe -> on, M.2 -> off
3 (11): mPCIe -> on, M.2 -> on
Example:
>>> rfm = RFM() >>> rfm.set_power_status(1)
- Parameters:
value (int) – module power status 0 ~ 3
- Raises:
TypeError – The input parameters type error.
PSPInvalid – The input parameter is out of range.
PSPError – General PSP functional error.
- get_sim_status() int [source]
Get SIM card status.
bit 0 means M.2 module, bit 1 means mPCIe module
0: first sim, 1: second sim
0 (00): mPCIe -> first sim (SIM3), M.2 -> first sim (SIM1)
1 (01): mPCIe -> first sim (SIM3), M.2 -> second sim (SIM2)
2 (10): mPCIe -> second sim (SIM4), M.2 -> first sim (SIM1)
3 (11): mPCIe -> second sim (SIM4), M.2 -> second sim (SIM2)
Example:
>>> rfm = RFM() >>> sim_status = rfm.get_sim_status() 0
- set_sim_status(value: int) None [source]
Set SIM card status.
bit 0 means M.2 module, bit 1 means mPCIe module
0: first sim, 1: second sim
0 (00): mPCIe -> first sim (SIM3), M.2 -> first sim (SIM1)
1 (01): mPCIe -> first sim (SIM3), M.2 -> second sim (SIM2)
2 (10): mPCIe -> second sim (SIM4), M.2 -> first sim (SIM1)
3 (11): mPCIe -> second sim (SIM4), M.2 -> second sim (SIM2)
Example:
>>> rfm = RFM() >>> rfm.set_sim_status(2)
- Parameters:
value (int) – SIM card status 0 ~ 3
- Raises:
TypeError – The input parameters type error.
PSPInvalid – The input parameter is out of range.
PSPError – General PSP functional error.
12.2. Supported Platforms
The following platforms have been verified and confirmed to be supported: