|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.flightpanels.scs.Receiver
public class Receiver
The main class and entry point to the CAN Aerospace world. It manages network access and handles all protocol requirements. The receiver maintains a list of CAN ids the application subscribed to. Notification on data changes is available either via callback functions or through pointers to variables that shall be updated. Calling Receiver::requestData enables you to communicate with all participants on the bus. It is the sole thing to do for interaction with the simulator. For more advanced use cases, like custom node services and publishing own data, inherit from Receiver and reimplement handleSTS, handleMCS and handleDRS functions. For even more customization, you can implement the CanAeroDataManager interface. Thread safety: This class is reentrant. Callbacks are guaranteed to be invoked from the same thread the Receiver::run() function is called.
| Method Summary | |
|---|---|
boolean |
handleDRS(long id)
Handle incoming data request services. |
void |
handleMCS(int module,
int mode)
Handle incoming module configuration services. |
void |
handleMIS()
Handle incoming module information services. |
void |
handleSTS()
Handle incoming state transmission services. |
void |
incomingData(can_t msg)
Handle incoming data the application subscribed to. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.lang.Boolean> update,
java.lang.Boolean ref)
Request to receive updates on the given CAN Id from the bus. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.lang.Double> update,
java.lang.Double ref)
Request to receive updates on the given CAN Id from the bus. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.lang.Float> update,
java.lang.Float ref)
Request to receive updates on the given CAN Id from the bus. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.lang.Integer> update,
java.lang.Integer ref)
Request to receive updates on the given CAN Id from the bus. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.lang.String> update,
java.lang.String ref)
Request to receive updates on the given CAN Id from the bus. |
void |
requestData(long id,
boolean id29,
IUpdateable<java.util.Vector<java.lang.Float>> update,
java.util.Vector<java.lang.Float> ref)
Request to receive updates on the given CAN Id from the bus. |
void |
run()
Call this repeatedly, either from the application's main loop or a separate application thread. |
void |
sendData(long id,
boolean id29,
java.lang.Object value)
Send value of given CAN id to the bus, so other participants are informed and can synchronize themselves to the new value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void requestData(long id,
boolean id29,
IUpdateable<java.lang.Integer> update,
java.lang.Integer ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.
public void requestData(long id,
boolean id29,
IUpdateable<java.lang.Float> update,
java.lang.Float ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.
public void requestData(long id,
boolean id29,
IUpdateable<java.lang.Double> update,
java.lang.Double ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.
public void requestData(long id,
boolean id29,
IUpdateable<java.lang.Boolean> update,
java.lang.Boolean ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.
public void requestData(long id,
boolean id29,
IUpdateable<java.lang.String> update,
java.lang.String ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.
public void requestData(long id,
boolean id29,
IUpdateable<java.util.Vector<java.lang.Float>> update,
java.util.Vector<java.lang.Float> ref)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idupdate - callback function you want to be called when value is updatedref - dummy parameter to work around Java's stupid type-erasure.public boolean handleDRS(long id)
handleDRS in interface ICanAeroDataManagerid - CAN id of data to be transmitted (cyclic) from now on
public void handleMCS(int module,
int mode)
handleMCS in interface ICanAeroDataManagermodule - Module affectedmode - Mode parameter that shall be passed to this modulepublic void handleSTS()
handleSTS in interface ICanAeroDataManagerpublic void handleMIS()
handleMIS in interface ICanAeroDataManagerpublic void incomingData(can_t msg)
incomingData in interface ICanAeroDataManagermsg - Message containing normal operation data
public void sendData(long id,
boolean id29,
java.lang.Object value)
id - CAN id of simulation data, specified in identifier
distributionid29 - True for 29 bit, false for 11 bit CAN idvalue - value to send to the bus Contrary to the C++ version, this is
not type-safe and allows you to send malformed massages. You
need to know what you are doing.public void run()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||