The Coronis SDK - SerialDriver API allows connecting your modem through a serial driver low level protocol.
Only the Coronis rs232Driver implementation is available in the current version.
The Serial Driver API offer service to manage the dataflow on the serial port and ensures to the upper layer that provided data are correct and correspond to those sent by the RF Modem:
open, close, send, receive, etc.
A more detailed information about RS232Driver implementation can be obtained from Serial Driver developer guide [RS232Driver_DevelopperGuide]
First, you have to create a new Java project into eclipse environment.
Coronis SDK has been design with JDK1.5.
In this tutorial, we will use the Coronis RS232Driver implementation of SerialDriver API.
The Java implementation is based on the C native implementation.
Get the last Coronis RS232Driver delivery package
Copy the following java libraries into a subfolder lib of the user project:
Copy the csrs232driver.properties file to the root of the user project
Add SerialDriver API, RS232driver and Domain libraries into the Java build path (project properties)
Execution reference to the RS232driver C native library:
To use a serial driver implementation user has 2 possibilities:
The second possibility is recommended for usage in OSGI context (dynamic module system for java).
In this tutorial, we suppose that user has connected a Waveport radio modem on Port COM4.
We will send the frame 0x5005, which correspond to the local service request READ_RADIO_ADDRESS. So we must receive spontaneously after the sending, a frame which begins with 0x51
Here are the main step that must be done before be able to send the frame:
Send the frame
At the end, following steps must be done before quit the program:
Coronis Domain module offers a logging feature, that is used by the rs232driver implementation to give internal process information.
The Java implementation of the logger feature is based on the C native implementation, thus a reference to the Domain C native library must be done in the execution context.
To activate it, user has to follow these steps:
Source of main program can be found here : [Java Serial Driver tutorial sources]
This example is available as an eclipse project (com.coronis.sdk.serialdriver.rs232driver.example.zip) inside the Coronis RS232Driver delivery package.
To have more details information about Serial Driver API, refer the documentation Java SerialDriver API
Wiki: Home
Wiki: Java Serial Driver tutorial sources
Wiki: RS232Driver_DevelopperGuide