ham-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Ham.CAT

Synopsis

Documentation

data CATConfig Source #

Configuration for the CAT monad.

Constructors

CATConfig 

Fields

Instances
Show CATConfig Source # 
Instance details

Defined in Ham.Internal.CAT

Generic CATConfig Source # 
Instance details

Defined in Ham.Internal.CAT

Associated Types

type Rep CATConfig :: Type -> Type #

ToJSON CATConfig Source # 
Instance details

Defined in Ham.Internal.CAT

FromJSON CATConfig Source # 
Instance details

Defined in Ham.Internal.CAT

type Rep CATConfig Source # 
Instance details

Defined in Ham.Internal.CAT

type Rep CATConfig = D1 (MetaData "CATConfig" "Ham.Internal.CAT" "ham-0.1.0.0-8Jb3s78JRYM4BaePNf8wNc" False) (C1 (MetaCons "CATConfig" PrefixI True) (S1 (MetaSel (Just "catPort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "catRadio") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Radio) :*: S1 (MetaSel (Just "catSerialSettings") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SerialPortSettings))))

defaultConfig :: CATConfig Source #

Default configuration. Note this assumes port and radio, so you will want to adjust it.

data CATState Source #

State type for the CAT monad.

Constructors

CATState 

Fields

defaultState :: CATState Source #

Default state. Note that this sets the SerialCAT to a default implementation. You will want to change that.

data CATError Source #

Constructors

CATError CATErrorType Text 
Instances
Show CATError Source # 
Instance details

Defined in Ham.Internal.CAT

newtype CAT m a Source #

The computer aided transceiver monad.

Constructors

CAT 
Instances
Monad m => Monad (CAT m) Source # 
Instance details

Defined in Ham.Internal.CAT

Methods

(>>=) :: CAT m a -> (a -> CAT m b) -> CAT m b #

(>>) :: CAT m a -> CAT m b -> CAT m b #

return :: a -> CAT m a #

fail :: String -> CAT m a #

Monad m => Functor (CAT m) Source # 
Instance details

Defined in Ham.Internal.CAT

Methods

fmap :: (a -> b) -> CAT m a -> CAT m b #

(<$) :: a -> CAT m b -> CAT m a #

Monad m => Applicative (CAT m) Source # 
Instance details

Defined in Ham.Internal.CAT

Methods

pure :: a -> CAT m a #

(<*>) :: CAT m (a -> b) -> CAT m a -> CAT m b #

liftA2 :: (a -> b -> c) -> CAT m a -> CAT m b -> CAT m c #

(*>) :: CAT m a -> CAT m b -> CAT m b #

(<*) :: CAT m a -> CAT m b -> CAT m a #

throwCAT :: Monad m => CATError -> CAT m a Source #

Throw an exception in the Overpass monad.

catchCAT :: Monad m => CAT m a -> (CATError -> CAT m a) -> CAT m a Source #

Catching exceptions in the Overpass monad.

runCAT Source #

Arguments

:: MonadIO m 
=> CATConfig 
-> CATState

State to start with.

-> CAT m a 
-> m (Either CATError (a, [Text])) 

Run an action in the CAT monad.

catInit :: MonadIO m => CAT m () Source #

FIXME: Add error handling. What if the radio can not be opened?

catDeinit :: MonadIO m => CAT m () Source #

Close everything down.

catFrequency :: MonadIO m => CAT m (Maybe Frequency) Source #

Get the current frequency from the transceiver.

catMode :: MonadIO m => CAT m (Maybe QsoMode) Source #

Get the current mode from the transceiver.

catPowerSSB :: MonadIO m => CAT m (Maybe Int) Source #

Get the SSB power setting in watts.

catSetPowerSSB :: MonadIO m => Int -> CAT m () Source #

Set the SSB power in watts.