Portability | portable |
---|---|
Stability | provisional |
Maintainer | eocallaghan@alterapraxis.com |
Safe Haskell | None |
This module encapsulates the foundational libbladeRF functions commonly used into a Monadic style. This Monadic style avoids passing around references of indirection to the device type and so on.
- withBladeRF :: (DeviceHandle -> IO c) -> IO c
- newtype DeviceHandle = DeviceHandle {
- unDeviceHandle :: Ptr C'bladerf
- data BladeRFError
- = BLADERF_ERR_UNEXPECTED
- | BLADERF_ERR_RANGE
- | BLADERF_ERR_INVAL
- | BLADERF_ERR_MEM
- | BLADERF_ERR_IO
- | BLADERF_ERR_TIMEOUT
- | BLADERF_ERR_NODEV
- | BLADERF_ERR_UNSUPPORTED
- | BLADERF_ERR_MISALIGNED
- | BLADERF_ERR_CHECKSUM
- | BLADERF_ERR_NO_FILE
- | BLADERF_ERR_UPDATE_FPGA
- | BLADERF_ERR_UPDATE_FW
- | BLADERF_ERR_TIME_PAST
- type BladeRFReturnType a = Either BladeRFError a
- bladeRFErrorValue :: CInt -> BladeRFReturnType Int
- bladeRFErrorTy :: CInt -> BladeRFReturnType ()
Documentation
withBladeRF :: (DeviceHandle -> IO c) -> IO cSource
Essential wrapper
newtype DeviceHandle Source
DeviceHandle wrapper around C device descriptor pointer
DeviceHandle | |
|
data BladeRFError Source
Error codes returned by internal libbladeRF functions.
BLADERF_ERR_UNEXPECTED | An unexpected failure occurred |
BLADERF_ERR_RANGE | Provided parameter is out of range |
BLADERF_ERR_INVAL | Invalid operation/parameter |
BLADERF_ERR_MEM | Memory allocation error |
BLADERF_ERR_IO | FileDevice IO error |
BLADERF_ERR_TIMEOUT | Operation timed out |
BLADERF_ERR_NODEV | No device(s) available |
BLADERF_ERR_UNSUPPORTED | Operation not supported |
BLADERF_ERR_MISALIGNED | Misaligned flash access |
BLADERF_ERR_CHECKSUM | Invalid checksum |
BLADERF_ERR_NO_FILE | File not found |
BLADERF_ERR_UPDATE_FPGA | An FPGA update is required |
BLADERF_ERR_UPDATE_FW | A firmware update is requied |
BLADERF_ERR_TIME_PAST | Requested timestamp is in the past |
Enum BladeRFError | Returned C Error codes bladeRF library routines return negative values to indicate errors. Values >= 0 are used to indicate success. |
Eq BladeRFError | |
Show BladeRFError | |
Typeable BladeRFError | |
Exception BladeRFError |
type BladeRFReturnType a = Either BladeRFError aSource
Short-hand type for brevity and clarity.
bladeRFErrorValue :: CInt -> BladeRFReturnType IntSource
(For internal use) Obtain a BladeRFError
type of a C value from the Error codes list.
bladeRFErrorTy :: CInt -> BladeRFReturnType ()Source
(For internal use) Obtain a BladeRFError
type of a C value from the Error codes list.