-
public class RawCanManager class for raw can.
Usage: Create instance RawCan, initialise init or init
Note! The connection towards the underlying service is asynchronous. This means that data is not ready immediately after init. This can affect the readiness of see sendMessage. To know if underlying service is ready use isServiceReady
-
-
Field Summary
Fields Modifier and Type Field Description public final static intCAN4public final static intSENSOR_NW_CANpublic final static intCAN3
-
Method Summary
Modifier and Type Method Description booleanisServiceReady()Can be used to poll if service is ready. voidinit(int canChannel, Array<int> filterId)Initialise object with can channel and array of filters. voidinit(int canChannel, Array<int> canFilterId, Handler handler)Initialise object with can channel and array of filters. booleansendMessage(CanFrame frame)Send a CAN-frame voidregisterCanMessageListener(CanMessageListener canMessageListener)Register listener to start listening on CAN-messages based on the filter providedin the init methods. voiddeInit()Deregister the raw can interface. -
-
Constructor Detail
-
RawCan
RawCan(Context appC)
-
-
Method Detail
-
isServiceReady
boolean isServiceReady()
Can be used to poll if service is ready.
-
init
void init(int canChannel, Array<int> filterId)
Initialise object with can channel and array of filters.
- Parameters:
canChannel- see SENSOR_NW_CAN and CAN4filterId- array of can filters
-
init
void init(int canChannel, Array<int> canFilterId, Handler handler)
Initialise object with can channel and array of filters.
- Parameters:
canChannel- see SENSOR_NW_CAN and CAN4canFilterId- array of can filtershandler- handler to post callbacks on
-
sendMessage
boolean sendMessage(CanFrame frame)
Send a CAN-frame
- Parameters:
frame- The CanFrame object to send
-
registerCanMessageListener
void registerCanMessageListener(CanMessageListener canMessageListener)
Register listener to start listening on CAN-messages based on the filter providedin the init methods.
- Parameters:
canMessageListener- the listener object.
-
deInit
void deInit()
Deregister the raw can interface.
-
-
-
-