Baud (final Prototype) Mac OS
If you follow me on Twitter, you saw that I (finally) got a PowerBop and even connected it to the Internet. What is a Powerbop ? A computer proposed by Apple and France Telecom in the 90’s : I talked about it here, it was a device that could connect to the France Telecom BiBop network.
En français.
The BiBop network was one of the first mobile phone network in the early 90’s. Launched in Paris, Strasbourg and Lille, the network consisted in a set of base stations, with limited scope, placed in the streets. To make it simple, the Bibop network was pretty close to the DECT technology : we had to manually register on a public base station and you could make and receive calls when you were close to the base station. The transition from one base station to another was not planned and the base stations locations were indicated by stickers on light poles or on buildings. In Paris, you can still find the stickers in question, even if the network no longer exists.
Overall, merely choose one that suits you best no matter whether it is a wireframe, mockup or prototype tool. 4 Best Free Mockup Tools for Mac UX/UI Designer. Since many app model tools are not pure wireframe/mockup/prototype tools, here we will illustrate 4 best free mockup tools for UX/UI designers to build an excellent mockup on a Mac. The Macintosh project began in 1979 when Jef Raskin, an Apple employee, envisioned an easy-to-use, low-cost computer for the average consumer.He wanted to name the computer after his favorite type of apple, the McIntosh, but the spelling was changed to 'Macintosh' for legal reasons as the original was the same spelling as that used by McIntosh Laboratory, Inc., an audio equipment.
Interestingly, long before the concept of femtocell, France Telecom sold private base stations for use at home. The base is plugged to the telephone network and you could use the same phone on the outside (on public base stations) and at home (on a private base station). France Telecom (and others) have proposed various models of base stations and telephones, I will come back to that point later.
The PowerBop
The Powerbop is a PowerBook 180 modified by France Telecom. Basically, the internal floppy drive is replaced by a BiBop module and an external floppy drive (the same as the PowerBook Duo or PowerBook 100) is proposed. The PowerBop is pretty rare, only a few hundred copies were produced.
Antenna
With a MacBook Air
Connecting the PowerBop was a struggle. First, I had to reinstall it. Between the data backup and the discs hunt, I had a hard time. And when I finally got a ready-to-go machine, I realized that my base station was not working. I could connect the PowerBop (or a BiBop phone) on it but not get a dial tone.
So I had to find a second (functional) base station before I realized … that the modem had obviously toasted. Indeed, my PowerBop BiBop module had stopped operating during testing. So I found a second PowerBop that worked before I realized that the hard drive of my model was dead. It was (audibly) suffering for the first test, he died during the latter. Fortunately, I had a hard drive in stock, so I reinstalled the machine a second time, accompanied by the gentle sound of floppy.
Second step, connect it to the Internet. Generally, I use a line simulator with either an AirPort modem or a Raspberry Pi, but in this case, it was impossible. The connection is not made with the PowerBop module, and I could not find a good reason fot it. It works with an external ExpressModem, but it does not with a PowerBop module. Minor annoyance, the sound of the modem is extremely loud : the PowerBop uses an external ExpressModem (a modem managed partially by the Mac software) and the AT commands to mute the sound do not work. My friend, my neighbors (and later my colleagues) may have cursed me.
So I went on a real line, with a conventional FAI and it worked.
Connected
Next, there is the issue of the browser. Browsers for old systems are indeed unable to load recent pages, filled with Javascript, non-supported images with redirects that do not work. So I used a disreputable but working website : rotten.com.
The connection is made at 9600 baud (just over 1 kB/s), although in theory it should reach 14400 baud. I also have struggled badly to configure Mac PPP, since the modem initialization string are not added automatically, I had to try several strings before finding the right one for this type of modem.
In fact, it’s slow, it’s compatible with nothing … but I did it.
Oddly enough, the Genius looked at me funny when I came to explain that I could not connect…
Apple Store
-->Device Class registration
Each device class follows the same principle for registration. A structure containing specific class parameters is passed to the class initialize function.
Each class can register, optionally, a callback function when a instance of the class gets activated. The callback is then called by the device stack to inform the application that an instance was created.
The application would have in its body the 2 functions for activation and deactivation, as shown in the following example.
It is not recommended to do anything within these functions but to memorize the instance of the class and synchronize with the rest of the application.
USB Device Storage Class
The USB device storage class allows for a storage device embedded in the system to be made visible to a USB host.
The USB device storage class does not by itself provide a storage solution. It merely accepts and interprets SCSI requests coming from the host. When one of these requests is a read or a write command, it will invoke a pre-defined call back to a real storage device handler, such as an ATA device driver or a Flash device driver.
When initializing the device storage class, a pointer structure is given to the class that contains all the information necessary. An example is given below.
In this example, the driver storage strings are customized by assigning string pointers to corresponding parameter. If any one of the string pointer is left to UX_NULL, the default Azure RTOS string is used.
In this example, the drive's last block address or LBA is given as well as the logical sector size. The LBA is the number of sectors available in the media –1. The block length is set to 512 in regular storage media. It can be set to 2048 for optical drives.
The application needs to pass three callback function pointers to allow the storage class to read, write and obtain status for the media.
The prototypes for the read and write functions are shown in the example below.
Where:
- storage is the instance of the storage class.
- lun is the LUN the command is directed to.
- data_pointer is the address of the buffer to be used for reading or writing.
- number_blocks is the number of sectors to read/write.
- lba is the sector address to read.
- media_status should be filled out exactly like the media status callback return value.
The return value can have either the value UX_SUCCESS or UX_ERROR indicating a successful or unsuccessful operation. These operations do not need to return any other error codes. If there is an error in any operation, the storage class will invoke the status call back function.
This function has the following prototype.
The calling parameter media_id is not currently used and should always be 0. In the future it may be used to distinguish multiple storage devices or storage devices with multiple SCSI LUNs. This version of the storage class does not support multiple instances of the storage class or storage devices with multiple SCSI LUNs.
The return value is a SCSI error code that can have the following format.
- Bits 0-7 Sense_key
- Bits 8-15 Additional Sense Code
- Bits 16-23 Additional Sense Code Qualifier
The following table provides the possible Sense/ASC/ASCQ combinations.
Sense Key | ASC | ASCQ | Description |
---|---|---|---|
00 | 00 | 00 | NO SENSE |
01 | 17 | 01 | RECOVERED DATA WITH RETRIES |
01 | 18 | 00 | RECOVERED DATA WITH ECC |
02 | 04 | 01 | LOGICAL DRIVE NOT READY - BECOMING READY |
02 | 04 | 02 | LOGICAL DRIVE NOT READY - INITIALIZATION REQUIRED |
02 | 04 | 04 | LOGICAL UNIT NOT READY - FORMAT IN PROGRESS |
02 | 04 | FF | LOGICAL DRIVE NOT READY - DEVICE IS BUSY |
02 | 06 | 00 | NO REFERENCE POSITION FOUND |
02 | 08 | 00 | LOGICAL UNIT COMMUNICATION FAILURE |
02 | 08 | 01 | LOGICAL UNIT COMMUNICATION TIME-OUT |
02 | 08 | 80 | LOGICAL UNIT COMMUNICATION OVERRUN |
02 | 3A | 00 | MEDIUM NOT PRESENT |
02 | 54 | 00 | USB TO HOST SYSTEM INTERFACE FAILURE |
02 | 80 | 00 | INSUFFICIENT RESOURCES |
02 | FF | FF | UNKNOWN ERROR |
03 | 02 | 00 | NO SEEK COMPLETE |
03 | 03 | 00 | WRITE FAULT |
03 | 10 | 00 | ID CRC ERROR |
03 | 11 | 00 | UNRECOVERED READ ERROR |
03 | 12 | 00 | ADDRESS MARK NOT FOUND FOR ID FIELD |
03 | 13 | 00 | ADDRESS MARK NOT FOUND FOR DATA FIELD |
03 | 14 | 00 | RECORDED ENTITY NOT FOUND |
03 | 30 | 01 | CANNOT READ MEDIUM - UNKNOWN FORMAT |
03 | 31 | 01 | FORMAT COMMAND FAILED |
04 | 40 | NN | DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH) |
05 | 1A | 00 | PARAMETER LIST LENGTH ERROR |
05 | 20 | 00 | INVALID COMMAND OPERATION CODE |
05 | 21 | 00 | LOGICAL BLOCK ADDRESS OUT OF RANGE |
05 | 24 | 00 | INVALID FIELD IN COMMAND PACKET |
05 | 25 | 00 | LOGICAL UNIT NOT SUPPORTED |
05 | 26 | 00 | INVALID FIELD IN PARAMETER LIST |
05 | 26 | 01 | PARAMETER NOT SUPPORTED |
05 | 26 | 02 | PARAMETER VALUE INVALID |
05 | 39 | 00 | SAVING PARAMETERS NOT SUPPORT |
06 | 28 | 00 | NOT READY TO READY TRANSITION – MEDIA CHANGED |
06 | 29 | 00 | POWER ON RESET OR BUS DEVICE RESET OCCURRED |
06 | 2F | 00 | COMMANDS CLEARED BY ANOTHER INITIATOR |
07 | 27 | 00 | WRITE PROTECTED MEDIA |
0B | 4E | 00 | OVERLAPPED COMMAND ATTEMPTED |
There are two additional, optional callbacks the application may implement; one is for responding to a GET_STATUS_NOTIFICATION command and the other is for responding to the SYNCHRONIZE_CACHE command.
If the application would like to handle the GET_STATUS_NOTIFICATION command from the host, it should implement a callback with the following prototype.
Where:
- storage is the instance of the storage class.
- media_id is not currently used. notification_class specifies the class of notification.
- media_notification should be set by the application to the buffer containing the response for the notification.
- media_notification_length should be set by the application to contain the length of the response buffer.
The return value indicates whether or not the command succeeded – should be either UX_SUCCESS or UX_ERROR.
If the application does not implement this callback, then upon receiving the GET_STATUS_NOTIFICATION command, USBX will notify the host that the command is not implemented.
The SYNCHRONIZE_CACHE command should be handled if the application is utilizing a cache for writes from the host. A host may send this command if it knows the storage device is about to be disconnected, for example, in Windows, if you right click a flash drive icon in the toolbar and select 'Eject [storage device name]', Windows will issue the SYNCHRONIZE_CACHE command to that device.
If the application would like to handle the GET_STATUS_NOTIFICATION command from the host, it should implement a callback with the following prototype.
Where:
- storage is the instance of the storage class.
- lun parameter specifies which LUN the command is directed to.
- number_blocks specifies the number of blocks to synchronize.
- lba is the sector address of the first block to synchronize.
- media_status should be filled out exactly like the media status callback return value.
The return value indicates whether or not the command succeeded – should be either UX_SUCCESS or UX_ERROR.
Multiple SCSI LUN
The USBX device storage class supports multiple LUNs. It is therefore possible to create a storage device that acts as a CD-ROM and a Flash disk at the same time. In such a case, the initialization would be slightly different. Here is an example for a Flash Disk and CD-ROM:
USB Device CDC-ACM Class
The USB device CDC-ACM class allows for a USB host system to communicate with the device as a serial device. This class is based on the USB standard and is a subset of the CDC standard.
A CDC-ACM compliant device framework needs to be declared by the device stack. An example is found here below.
The CDC-ACM class uses a composite device framework to group interfaces (control and data). As a result care should be taken when defining the device descriptor. USBX relies on the IAD descriptor to know internally how to bind interfaces. The IAD descriptor should be declared before the interfaces and contain the first interface of the CDC-ACM class and how many interfaces are attached.
The CDC-ACM class also uses a union functional descriptor which performs the same function as the newer IAD descriptor. Although a Union Functional descriptor must be declared for historical reasons and compatibility with the host side, it is not used by USBX.
The initialization of the CDC-ACM class expects the following parameters.
The 2 parameters defined are callback pointers into the user applications that will be called when the stack activates or deactivate this class.
The third parameter defined is a callback pointer to the user application that will be called when there is line coding or line states parameter change. E.g., when there is request from host to change DTR state to TRUE, the callback is invoked, in it user application can check line states through IOCTL function to kow host is ready for communication.
The CDC-ACM is based on a USB-IF standard and is automatically recognized by MACOs and Linux operating systems. On Windows platforms, this class requires a .inf file for Windows version prior to 10. Windows 10 does not require any .inf files. We supply a template for the CDC-ACM class and it can be found in the usbx_windows_host_files directory. For more recent version of Windows the file CDC_ACM_Template_Win7_64bit.inf should be used (except Win10). This file needs to be modified to reflect the PID/VID used by the device. The PID/VID will be specific to the final customer when the company and the product are registered with the USB-IF. In the inf file, the fields to modify are located here.
In the device framework of the CDC-ACM device, the PID/VID are stored in the device descriptor (see the device descriptor declared above).
When a USB host systems discovers the USB CDC-ACM device, it will mount a serial class and the device can be used with any serial terminal program. See the host Operating System for reference.
The CDC-ACM class API functions are defined below.
ux_device_class_cdc_acm_ioctl
Perform IOCTL on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to perform various ioctl calls to the cdc acm interface
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: Ioctl function to be performed.
- parameter: Pointer to a parameter specific to the ioctl call.
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_ERROR (0xFF) Error from function
Example
Ioctl functions:
Function | Value |
---|---|
UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING | 1 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING | 2 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_STATE | 3 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_ABORT_PIPE | 4 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE | 5 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_START | 6 |
UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_STOP | 7 |
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING
Perform IOCTL Set Line Coding on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to Set the Line Coding parameters.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING
- parameter: Pointer to a line parameter structure:
Return Value
UX_SUCCESS (0x00) This operation was successful.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING
Perform IOCTL Get Line Coding on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to Get the Line Coding parameters.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_GET_ LINE_CODING
- parameter: Pointer to a line parameter structure:
Return Value
- UX_SUCCESS (0x00) This operation was successful.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_STATE
Perform IOCTL Get Line State on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to Get the Line State parameters.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_STATE
- parameter: Pointer to a line parameter structure:
Return Value
- UX_SUCCESS (0x00) This operation was successful.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE
Perform IOCTL Set Line State on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to Get the Line State parameters
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE
- parameter: Pointer to a line parameter structure:
Return Value
- UX_SUCCESS (0x00) This operation was successful.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_ABORT_PIPE
Perform IOCTL ABORT PIPE on the CDC-ACM interface
Prototype
Description
This function is called when an application needs to abort a pipe. For example, to abort an ongoing write, UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_XMIT should be passed as the parameter.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_ABORT_PIPE
- parameter: The pipe direction:
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_ENDPOINT_HANDLE_UNKNOWN (0x53) Invalid pipe direction.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_START
Perform IOCTL Transmission Start on the CDC-ACM interface
Prototype
Description
This function is called when an application wants to use transmission with callback.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_START
- parameter: Pointer to the Start Transmission parameter structure:
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_ERROR (0xFF) Transmission already started.
- UX_MEMORY_INSUFFICIENT (0x12) A memory allocation failed.
Example
ux_device_class_cdc_acm_ioctl: UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_STOP
Perform IOCTL Transmission Stop on the CDC-ACM interface
Prototype
Description
This function is called when an application wants to stop using transmission with callback.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- ioctl_function: ux_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSI ON_STOP
- parameter: Not used
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_ERROR (0xFF) No ongoing transmission.
Example
ux_device_class_cdc_acm_read
Read from CDC-ACM pipe
Prototype
Description
This function is called when an application needs to read from the OUT data pipe (OUT from the host, IN from the device). It is blocking.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- buffer: Buffer address where data will be stored.
- requested_length: The maximum length we expect.
- actual_length: The length returned into the buffer.
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_CONFIGURATION_HANDLE_UNKNOWN (0x51) Device is no longer in the configured state.
- UX_TRANSFER_NO_ANSWER (0x22) No answer from device. The device was probably disconnected while the transfer was pending.
Example
ux_device_class_cdc_acm_write
Write to a CDC-ACM pipe
Prototype
Description
This function is called when an application needs to write to the IN data pipe (IN from the host, OUT from the device). It is blocking.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- buffer: Buffer address where data is stored.
- requested_length: The length of the buffer to write.
- actual_length: The length returned into the buffer after write is performed.
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_CONFIGURATION_HANDLE_UNKNOWN (0x51) Device is no longer in the configured state.
- UX_TRANSFER_NO_ANSWER (0x22) No answer from device. The device was probably disconnected while the transfer was pending.
Example
ux_device_class_cdc_acm_write_with_callback
Writing to a CDC-ACM pipe with callback
Prototype
Description
This function is called when an application needs to write to the IN data pipe (IN from the host, OUT from the device). This function is non-blocking and the completion will be done through a callback set in UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_START.
Parameters
- cdc_acm: Pointer to the cdc class instance.
- buffer: Buffer address where data is stored.
- requested_length: The length of the buffer to write.
- actual_length: The length returned into the buffer after write is performed
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_CONFIGURATION_HANDLE_UNKNOWN (0x51) Device is no longer in the configured state.
- UX_TRANSFER_NO_ANSWER (0x22) No answer from device. The device was probably disconnected while the transfer was pending.
Example
USB Device CDC-ECM Class
The USB device CDC-ECM class allows for a USB host system to communicate with the device as a ethernet device. This class is based on the USB standard and is a subset of the CDC standard.
Baud (final Prototype) Mac Os 7
A CDC-ACM compliant device framework needs to be declared by the device stack. An example is found here below.
The CDC-ECM class uses a very similar device descriptor approach to the CDC-ACM and also requires an IAD descriptor. See the CDC-ACM class for definition.
In addition to the regular device framework, the CDC-ECM requires special string descriptors. An example is given below.
The MAC address string descriptor is used by the CDC-ECM class to reply to the host queries as to what MAC address the device is answering to at the TCP/IP protocol. It can be set to the device choice but must be defined here.
The initialization of the CDC-ECM class is as follows.
The initialization of this class expects the same function callback for activation and deactivation, although here as an exercise they are set to NULL so that no callback is performed.
The next parameters are for the definition of the node IDs. 2 Nodes are necessary for the CDC-ECM, a local node and a remote node. The local node specifies the MAC address of the device, while the remote node specifies the MAC address of the host. The remote node must be the same one as the one declared in the device framework string descriptor.
The CDC-ECM class has built-in APIs for transferring data both ways but they are hidden to the application as the user application will communicate with the USB Ethernet device through NetX.
The USBX CDC-ECM class is closely tied to Azure RTOS NetX Network stack. An application using both NetX and USBX CDC-ECM class will activate the NetX network stack in its usual way but in addition needs to activate the USB network stack as follows.
The USB network stack needs to be activated only once and is not specific to CDCECM but is required by any USB class that requires NetX services.
The CDC-ECM class will be recognized by MAC OS and Linux hosts. But there is no driver supplied by Microsoft Windows to recognize CDC-ECM natively. Some commercial products do exist for Windows platforms and they supply their own .inf file. This file will need to be modified the same way as the CDC-ACM inf template to match the PID/VID of the USB network device.
USB Device HID Class
The USB device HID class allows for a USB host system to connect to a HID device with specific HID client capabilities.
USBX HID device class is relatively simple compared to the host side. It is closely tied to the behavior of the device and its HID descriptor.
Any HID client requires first to define a HID device framework as the example below.
The HID framework contains an interface descriptor that describes the HID class and the HID device subclass. The HID interface can be a standalone class or part of a composite device.
Currently, the USBX HID class does not support multiple report IDs, as most applications only require one ID (ID zero). If multiple report IDs is a feature you are interested in, please contact us.
The initialization of the HID class is as follow, using a USB keyboard as an example.
The application needs to pass to the HID class a HID report descriptor and its length. The report descriptor is a collection of items that describe the device. For more information on the HID grammar refer to the HID USB class specification.
In addition to the report descriptor, the application passes a call back when a HID event happens.
The USBX HID class supports the following standard HID commands from the host.
Command name | Value | Description |
---|---|---|
UX_DEVICE_CLASS_HID_COMMAND_GET_REPORT | 0x01 | Get a report from the device |
UX_DEVICE_CLASS_HID_COMMAND_GET_IDLE | 0x02 | Get the idle frequency of the interrupt endpoint |
UX_DEVICE_CLASS_HID_COMMAND_GET_PROTOCOL | 0x03 | Get the protocol running on the device |
UX_DEVICE_CLASS_HID_COMMAND_SET_REPORT | 0x09 | Set a report to the device |
UX_DEVICE_CLASS_HID_COMMAND_SET_IDLE | 0x0a | Set the idle frequency of the interrupt endpoint |
UX_DEVICE_CLASS_HID_COMMAND_SET_PROTOCOL | 0x0b | Get the protocol running on the device |
The Get and Set report are the most commonly used commands by HID to transfer data back and forth between the host and the device. Most commonly the host sends data on the control endpoint but can receive data either on the interrupt endpoint or by issuing a GET_REPORT command to fetch the data on the control endpoint.
The HID class can send data back to the host on the interrupt endpoint by using the ux_device_class_hid_event_set function.
ux_device_class_hid_event_set
Setting an event to the HID class
Prototype
Description
This function is called when an application needs to send a HID event back to the host. The function is not blocking, it merely puts the report into a circular queue and returns to the application.
Parameters
- hid: Pointer to the hid class instance.
- hid_event: Pointer to structure of the hid event.
Return Value
- UX_SUCCESS (0x00) This operation was successful.
- UX_ERROR (0xFF) Error no space available in circular queue.
Example
The callback defined at the initialization of the HID class performs the opposite of sending an event. It gets as input the event sent by the host. The prototype of the callback is as follows.
hid_callback
Getting an event from the HID class
Prototype
Description
This function is called when the host sends a HID report to the application.
Baud (final Prototype) Mac Os X
Parameters
- hid: Pointer to the hid class instance.
- hid_event: Pointer to structure of the hid event.
Example
The following example shows how to interpret an event for a HID keyboard: