Lantronix 900-332 Commands, Configurable Pins, Byte 0 Command Types, Command 10h, Get Functions

Page 68

Configurable Pins

The protocol allows for control of up to 32 GPIOs. How many are actually available depends on the product. WiPort has only three.

The parameters are four bytes long and represent GPIOs 0-31, with GPIO0 in bit 0 of the first byte (Little Endian). Parameter bits for configurable pins not configured as GPIOs are undefined for Get commands and ignored on Set commands.

Every command consists of nine bytes: one command type of one byte and two parameters of four bytes each.

 

Command

 

 

 

Parameter 1

 

 

 

 

 

Parameter 2

 

 

Byte

0

 

1

2

 

3

4

5

 

6

 

7

8

Pin Number

 

0

 

7

8

 

15

16

23

24

31

0

 

7

8

 

15

16

23

24

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

On some commands, one or all parameters are ignored.

For UDP, command type and parameters need to be in the same datagram.

Responses to valid commands are always five bytes long, consisting of the returned command byte and as parameters in the current or updated values. In case of an invalid command, only one byte with value 0FFh is returned.

 

Command

 

 

 

Parameter 1

 

 

 

 

Byte

0

 

1

2

 

3

4

Pin Number

 

0

 

7

8

15

16

 

23

24

31

When sending a command (TCP and UDP), wait for the response before sending the next command.

Commands

Byte 0 Command Types

10h

Get functions

 

 

11h

Get directions (input or output)

 

 

12h

Get active levels (high active or low active)

 

 

13h

Get current states (active or not active)

 

 

19h

Set directions

 

 

1Ah

Set active levels

 

 

1Bh

Set current states

 

 

As you can, see there is no Set functions command. Since the pin’s function depends on the hardware in which the WiPort is embedded, that configuration is only allowed via 77FE. Settings changed by any of the Set commands are not stored and are lost when the unit is powered down or rebooted.

Command 10h, Get Functions

Send:

No parameters

Response:

1 parameter

Bytes 1-4: Functions

Bit X 1 means general purpose IO available to the user.

6-2

WiPort™ User Guide

Image 68
Contents WiPort User Guide Page Sales Offices Lantronix Corporate HeadquartersTechnical Support Disclaimer and Revisions Contents Contents Accessing Setup ModeWlan Settings5-19 Expert Settings5-20Factory Defaults Exit Configuration ModeGpio Pins Control ProtocolPage Using This Guide Purpose and AudienceChapter Summary Remaining chapters in this guide includeUsing This Guide Additional DocumentationIntroduction CapabilitiesConfiguration Methods ApplicationsProtocol Support IntroductionAddresses and Port Numbers Hardware AddressIP Address Port NumbersPage Server Configuration Configuration using DeviceInstallerAccessing WiPort using DeviceInstaller Wlan Configuration Configuration Using DeviceInstaller Host List ConfigurationOEM Pin Configuration Channel 1 and Channel 2 Configuration Common I/F Mode Setting Serial SettingsUDP Datagram Mode Passive ConnectionActive Connection Buffer Flushing DisconnectionConnection Email Configuration PackingTriggers Unit NamePage Configuration using Web-Manager Accessing WiPort using Web-ManagerNetwork Configuration Configuration Using Web-ManagerAutomatic IP Address Configuration Static IP Address ConfigurationClick the OK button when finished Select Obtain IP address automaticallySelect Use the following IP configuration Default GatewayIP Address Subnet MaskServer Configuration AdvancedHost Information Serial SettingsRetry Settings Port Settings Disable Serial PortAvailable fields, enter the following information ChannelConnection Settings TCP Pack ControlFlush Input Buffer Serial to Network Flush Output Buffer Network to SerialConnect Protocol Connect Mode Passive ConnectionConnect Mode Active Connection Common Options Endpoint ConfigurationDisconnect Mode Connection Settings UDP Datagram ModeMail Server IP Address Configure the following fieldsChange Address Table Configurable Pins Enable Serial TriggerRecipients ConditionsMessage Properties Enter or modify the following fields Ad Hoc SettingsWireless Network Security Advanced Settings Configure or modify the following fields for each pinUpdating Settings Page Telnet Access Configuration via Serial Mode or Telnet PortAccessing Setup Mode Click OK. The following information displays Serial Port AccessConfiguration Via Serial Mode or Telnet Port Set the IP Address Set the Gateway IP AddressChange Telnet Configuration Password Set the NetmaskDhcp Name Network Class Host Bits NetmaskInterface Mode Following table displays available I/F Mode optionsMode Option Interface Mode OptionsCommon I/F Mode Setting Binary Hex FlowPort Number Flow Control OptionConnect Mode Enter Connect Mode options in hexadecimal notationConnect Mode Option Port Numbers Reserved forIncoming Connection ResponseAutostart Automatic Connection Manual ConnectionManual Connection Address Example Hostlist Hostlist ExampleMessage Meaning Modem ModeDatagram Type Function Modem Mode CommandModem Mode Commands Remote Port Modem Mode Function CommandRemote IP Address Flush Mode Disconnect Mode Option10. Disconnect Mode Options 11. Flush Mode OptionsOption DisConnTime Inactivity Timeout Channel Port PasswordSendChar 1 and SendChar2 Telnet Terminal TypeMail Server Unit Name Domain NameRecipient TriggerWlan Settings Enable WlanEnable Ad Hoc Network Creation Find Network NameExpert Settings Security SettingsDisable Snmp Disable Telnet SetupDisable Tftp Firmware Upgrade Disable Port 77FE HexFactory Defaults Wlan Settings Channel 1 ConfigurationChannel 2 Configuration Exit Configuration Mode Expert SettingsSecurity Settings Email SettingsConfigurable Pins Gpio PinsFeatures Control ProtocolCommands Configurable PinsByte 0 Command Types Command 10h, Get FunctionsCommand 11h, Get Directions Command 12h, Get Active LevelsCommand 13h, Get Current States Command 19h, Set DirectionsCommand 1Ah, Set Active Levels Command 1Bh, Set StatesCommand details Examples1Bh = response to command 1Bh 03h, 00h, 00h, 00h = Page Monitor Mode Entering Monitor Mode via the Serial PortEntering Monitor Mode via the Network Port To enter Monitor Mode locallyMonitor Mode Commands Following commands are available in Monitor ModeCommand Command Name Function Monitoring the NetworkUsing Tftp Graphical User Interface Updating FirmwareObtaining Firmware Reloading Firmware ROM File FWX FileTroubleshooting Using Tftp Command Line InterfaceRecovering the Firmware Using the Serial Port Problem/Message Reason Solution TroubleshootingProblems and Error Messages Please try again Caps Lock is not onGeneral DeviceInstaller Settings Device Server messageTechnical Support Technical Support Europe, Middle East, and Africa