Page 1 of 1
More information about the EventSource in JC3.1
Posted: Wed Nov 28, 2018 12:46 am
by scplatform
According to public information, JavaCard 3.1 has an event mechanism that provides peripheral APIs. Does anybody has more relevant information about this topic?
Re: More information about the EventSource in JC3.1
Posted: Wed Nov 28, 2018 12:48 am
by scplatform
We can use it like this, but the information related to it is too little.
Code: Select all
EventSourcesrc= IOService.getInstance(IO_SPI);
//Register applet as MessageListenerfor the specified src
EventRegistry.getEventRegistry(src).register(this);
Re: More information about the EventSource in JC3.1
Posted: Wed Nov 28, 2018 12:52 am
by scplatform
Java Card 3.1 I/O framework can be used to create an API for applications to directly RW data from/to the specific peripherals.
The I/O framework is made of two new Java Card packages :
javacardx.framework.event
javacardx.framework.nio
javacardx.framework.event
The central abstractions of the event framework are:
Event sources which are I/O interfaces, devices or peripherals that may generate events
Event listeners which is the default interface used to receive events
Event registry which are used to register listeners for event sources
As the platform implementer we should to implement the Event sources, which could be include external peripheral or internal event source, e.g: GPIO/UART、Memory-mapped IO, I2C, SPI, watchdog etc.
Event listeners are the interfaces to be implemented by the application code to receive events. This could be : listeners for GPIO (PinListener and PortListener), listeners for UART interface (UARTEventListener), listeners for memory-mapped I/O (MMIOEventListener) and so on.
javacardx.framework.nio
This package contains classes to manipulate data. It defines buffers that are container providing an encapsulation of data and offering efficient methods to parse and extract structured information from raw data. These buffers can encapsulate data stored into arrays in the data heap, but can also be used to access memory out of the heap and map external memory (e.g. a peripheral).