Object <- Server <- HardwareStream <- MagicBusClient |
|
|
Attached CanHandlePeripheral Detached PeripheralRequest ReadPeripheral SetMaximumBlockLength WritePeripheral |
|
ClientVersion MagicBusPeripheralInfo MaxCurrent PeriphNumber PeripheralID PeripheralManufacturer |
PeripheralName PeripheralType QuiescentCurrent RealtimeMode TypicalCurrent |
| Field | Type | |
|---|---|---|
| Server: | enabled: | Boolean |
| Stream: | target: | Object |
| HardwareStream: | state: | Unsigned |
| readRate: | Unsigned | |
| writeRate: | Unsigned | |
| maxReadRate: | Unsigned | |
| maxWriteRate: | Unsigned | |
| defaultTimeout: | Unsigned | |
| MagicBusClient: | peripheralID: | Unsigned |
| peripheralName: | Object | |
| peripheralType: | Object | |
| peripheralManufacturer: | Object | |
| magicBusPeripheralInfo: | Object | |
| periphNumber: | UnsignedByte | |
| clientVersion: | UnsignedByte | |
| realtimeMode: | Boolean | |
| maxSendBlockLength: | Unsigned | |
| maxGetBlockLength: | Unsigned | |
| maxCurrent: | Signed | |
| typicalCurrent: | Signed | |
| quiescentCurrent: | Signed |
#endif // MAGICBUSKEYBOARD Define Class MagicBusClient; abstract; inherits from HardwareStream; field peripheralID: Unsigned, getter; // 3 byte peripheral ID registered with Magic field peripheralName: Object, getter; // Product Name -- Gizmo 2000 field peripheralType: Object, getter; // Type -- Printer, disk drive, etc. field peripheralManufacturer: Object, getter; // Name of Manufacturer field magicBusPeripheralInfo: Object, getter; // Peripheral info block field periphNumber: UnsignedByte, getter; // Starting with zero being the peripheral connected directly to the device, 1 is the next... field clientVersion: UnsignedByte, getter; // MagicBusClient version number field realtimeMode: Boolean, getter; // Peripheral's realtime mode status field maxSendBlockLength: Unsigned; // Maximum Send Block Length (restricted by IRQ latancy requirements // of other peripherals). field maxGetBlockLength: Unsigned; // Maximum Get Block Length (restricted by IRQ latancy requirements // of other peripherals). field maxCurrent: Signed, getter; // Max current (from MagicBus Vcc) consumed by a MagicBus User when // fully active (in uA) field typicalCurrent: Signed, getter; // Typical (Nominal) current (from MagicBus Vcc) consumed by a MagicBus // User when in normal operation (in uA) field quiescentCurrent: Signed, getter; // Typical (Nominal) current (from MagicBus Vcc) consumed by a MagicBus // User when in standby mode (in uA) class operation CanHandlePeripheral(peripheralID: Unsigned): Object, noMethod; // MagicBus passes the client an ID and the peripheral can choose to accept it operation ReadPeripheral(mbCommand: Unsigned; buffer: UnsignedArrayPointer; count: Unsigned): Unsigned; // Perform Get from peripheral. operation WritePeripheral(mbCommand: Unsigned; buffer: ReadOnlyUnsignedArrayPointer; count: Unsigned): Unsigned; // Perform Send (broken-up in smaller sections if needed) to peripheral. operation SetMaximumBlockLength(maxSendBlockLength: Unsigned; maxGetBlockLength: Unsigned); // MagicBus specifies the longest send and get block lengths. operation PeripheralRequest(request: ReadOnlyUnsignedByteArrayPointer; requestLength: Unsigned); operation Attached(); operation Detached(); // NO MagicBus CMD REQUESTS CAN BE MADE DURING OR AFTER THIS CALL !!!! attribute PeripheralID: Unsigned, readOnly; // Peripheral ID attribute PeripheralName: Object, readOnly; // Product Name -- Gizmo 2000 attribute PeripheralType: Object, readOnly; // Type -- Printer, disk drive, etc. attribute PeripheralManufacturer: Object, readOnly; // Name of Manufacturer attribute MagicBusPeripheralInfo: Object, readOnly; // Peripheral's Information block. attribute PeriphNumber: UnsignedByte, readOnly; // Starting with zero being the peripheral connected directly to the device, 1 is the next... attribute ClientVersion: UnsignedByte, readOnly; // MagicBusClient version number attribute RealtimeMode: Boolean; // Peripheral's realtime mode status attribute MaxCurrent: Signed, readOnly; // Max current (from MagicBus Vcc) consumed by a MagicBus User when // fully active (in uA) attribute TypicalCurrent: Signed, readOnly; // Typical (Nominal) current (from MagicBus Vcc) consumed by a MagicBus // User when in normal operation (in uA) attribute QuiescentCurrent: Signed, readOnly; // Typical (Nominal) current (from MagicBus Vcc) consumed by a MagicBus // User when in standby mode (in uA) end class;