|static ErlDrvData||kerlDriverStart (ErlDrvPort port, char *buff)|
|static void||kerlDriverStop (ErlDrvData handle)|
|static void||doFree (void *state)|
|static void||kerlDriverMain (void *asyncData)|
|static void||kerlDriverOutput (ErlDrvData handle, char *buff, int bufflen)|
|static void||kerlDriverReadyAsync (ErlDrvData drvData, ErlDrvThreadData asyncData)|
This contains code required to load a driver into Erlang allowing calls to be made to Player.
Erlang will initialize the driver allowing it to pass calls using Erlang Interface. This driver will wrap up the varibless passed from Erlang and pass it onto kerl.cpp which will allow robot control in player.
This driver runs concurrently.
Driver is explained: http://erlang.org/doc/man/driver_entry.html
|state||is the data passed into the driver Not currently used but called at the end of a function call|
Initialise erlang driver.
|asyncData||is the kerldata passed into the driver Contains the kerl main functions passed from the async driver. Decoding of the atoms passed from erlang is done here and decides what kerl function is needed to call. If no function can be called then an error is returned.|
|handle||pointer to the passed port information (todo: not sure ;))|
|buff||erlang port input string|
|bufflen||length of the input string Function calls to the driver go here before they run asynchronously. The memory has to be copied to avoid curruption and then a thread is spawned at the end.|
|drvData||the driver data passed|
|asyncData||the async data passed This function is called when a async thread has completed This function is called after an asynchronous call has completed. The asynchronous call is started with driver_async.|
|port||is the port|
|buff||any commands passed|
|handle||data This is called when the port is closed|