LANEscape Inter Access Point Protocol (LIAPP) Specification v0.3 Draft

类别:软件工程 点击:0 评论:0 推荐:
LANEscape Inter Access Point Protocol (LIAPP) Specification v0.3 Draft

 

 

 

 

 

  

 

 

1.     Introduction.. 3

2.     General description.. 3

2.1.      Relationships between services. 3

2.2.      Connection service. 4

2.3.      service. 4

3.     Frame formats. 5

3.1.      General frame format. 5

3.1.1.       Protocol Id field. 5

3.1.2.       Control field. 5

3.1.3.       Length field. 5

3.1.4.       Frame Id field. 5

3.1.5.       Frame body. 6

3.1.6.       FCS field. 6

3.2.      Format of individual frame types. 6

3.2.1.       Browse Request frame format 7

3.2.2.       Browse Response frame format 7

3.2.3.       Inquiry Request frame format 7

3.2.4.       Inquiry Response frame format 8

3.2.5.       Configuration Request frame format 8

3.2.6.       Configuration Response frame format 8

3.2.7.       Connection frame format 8

3.2.8.       File Open Request frame format 9

3.2.9.       File Open Response frame format 9

3.2.10.     File Close Request frame format 10

3.2.11.     File Close Response frame format 10

3.2.12.     File Write Request frame format 10

3.2.13.     File Write Response frame format 10

3.2.14.     File Read Request frame format 11

3.2.15.     File Read Response frame format 11

3.2.16.     User Defined Request frame format 11

3.2.17.     User Defined Response frame format 12

3.3.      Frame body components. 12

3.3.1.       User Id field. 12

3.3.2.       Status Code field. 12

3.3.3.       Manufacturer element 13

3.3.4.       Product Name element 13

3.3.5.       Model Name element 13

3.3.6.       Element IDs. 13

4.     Routines and Variables. 14

4.1.      Support routines provided by the LIAPP. 14

4.2.      Support routines provided by Utility Interface. 14

4.3.      Variables provided by LIAPP. 14

4.4.      Variables provided by Utility Interface. 15

 

Tables

Table 1 Frames permitted in states. 3

Table 2 LIAPP general frame format 5

Table 3 LIAPP control field. 5

Table 4 Frame Id descriptions. 5

Table 5 Frame body of Browse Request 7

Table 6 Frame body of Browse Response. 7

Table 7 Frame body of Inquiry Request 7

Table 8 Frame body of Inquiry Response. 8

Table 9 Frame body of Configuration Request 8

Table 10 Frame body of Configuration Response. 8

Table 11 Frame body of Connect Request 8

Table 12 Presence of user name information. 9

Table 13 Frame body of File Open Request 9

Table 14 Frame body of File Open Response. 9

Table 15 Frame body of File Close Request 10

Table 16 Frame body of File Close Response. 10

Table 16 Frame body of File Write Request 10

Table 16 Frame body of File Write Response. 10

Table 16 Frame body of File Read Request 11

Table 16 Frame body of File Read Response. 11

Table 17 Status Codes. 12

Table 18 Manufacturer element format 13

Table 19 Element ID field description. 13

Table 20 Element class description. 13

 

1.    Introduction

The LANEscape Inter Access Point Protocol (LIAPP) is developed on top of Utility Interface.

2.    General description

 

2.1.      Relationships between services

The relationships between these server state variables and services are given by

In State 1, only Class 1 frames are allowed. In State 2, either Class 1 or Class 2 frames are allowed.

Table 1 Frames permitted in states

State variable

Allowed frames

State 1: No connection

Class 1

State 2: Connected

Class 1 and Class 2

 

The frame classes are defined as follows:

a)          Class 1 frames (permitted from within States 1, 2)
1)   Browse Request/Response
2)   Connection: Successful connection enables a station to exchange Class 2 frames.
     Unsuccessful connection leaves the STA in State 1.
3)   Disconnection: Disconnection notification when in State 2 changes the station’s state to State 1.

b)          Class 2 frames (allowed from within States 2, 3, and 4)
1)   Inquiry Request/Response
2)   Configuration Request/Response
If a station A receives a Class 2 frame from station B within State 1, the station A shall send a Disconnection frame to station B.

2.2.      Connection service 2.3.       service 3.    Frame formats 3.1.      General frame format

Table 2 LIAPP general frame format

Protocol Id

Control

Length

Sequence

Frame Id

Frame body

FCS

2 bytes

1 byte

2 bytes

2 bytes

2 bytes

N bytes

2 bytes

3.1.1.         Protocol Id field

The Protocol Id field in a LIAPP frame should be 0xF557. The stations will ignore the frame with invalid Protocol Id value.

3.1.2.         Control field

Table 3 LIAPP control field

Bit 7 – Bit 6

Bit 5 – Bit 0

Protocol version

Reserved

3.1.3.         Length field

The Length field contains the number of bytes of Sequence, Frame Id, Frame body and CRC16 field.

3.1.4.         Frame Id field

Table 4 Frame Id descriptions

Frame Id

Description

0x0000

Browse Request

0x0001

Browse Response

0x0002

Inquiry Request

0x0003

Inquiry Response

0x0004

Connection

0x0005

Disconnection

0x0006

Configuration Request

0x0007

Configuration Response

0x0008

File Open Request

0x0009

File Open Response

0x000A

File Close Request

0x000B

File Close Response

0x000C

File Read Request

0x000D

File Read Response

0x000E

File Write Request

0x000F

File Write Response

0x0010

DIR Request

0x0011

DIR Response

0x0012

File Seek Request

0x0013

File Seek Response

0x0014

User Defined Request

0x0015

User Defined Response

 

3.1.5.         Frame body

The length of Frame body field can be arbitrary value but limited by the value of global variable LIAPP_MAXFRAMESIZE. The value of global variable LIAPP_MAXFRAMESIZE defines the maximum frame size of a LIAPP frame. The value of LIAPP_MAXFRAMESIZE can be preset by issuing InitLIAPP routine.

3.1.6.         FCS field

The Sequence, Frame Id and Frame body fields should be protected with a CCITT CRC-16 FCS (frame check sequence). The CCITT CRC-16 FCS shall be the remainder generated by the modulo 2 division of the fields by the polynomial:

The CRC16 bits are preset to all zeros. The protected bits shall be processed in transmit order.

3.2.      Format of individual frame types

 

3.2.1.         Browse Request frame format

The frame body of Browse Request contains the information shown in following table:

Table 5 Frame body of Browse Request

Order

Information

1

Manufacturer Id

2

Product Id

3

Model Name

 

3.2.2.         Browse Response frame format

The frame body of Browse Request contains the information shown in

Table 6 Frame body of Browse Response

Order

Information

1

Manufacturer Id

2

Product Id

3

Model Name

4

Device Name

5

Device Description

 

3.2.3.         Inquiry Request frame format

The frame body of Inquiry Request contains element IDs. The element ID list terminates by an End element ID.

Table 7 Frame body of Inquiry Request

Order

Information

Note

1

User Id

The User Id is given from server in connection frame with connection sequence 2.

2

Element Id 1

 

3

Element Id 2

 

...

 

N

Element Id N

 

N+1

Element Id: End

 

 

3.2.4.         Inquiry Response frame format

Table 8 Frame body of Inquiry Response

Order

Information

Note

1

User Id

The User Id is given from server in connection frame with connection sequence 2.

2

Status Code

 

3

Element 1

The elements only and if only present when Status Code is success

4

Element 2

N

Element N

N+1

Element End

3.2.5.         Configuration Request frame format

The frame body of Configuration Request frame contains the information components for configuration.

Table 9 Frame body of Configuration Request

Order

Information

1

User Id

2

Element 1

3

Element 2

...

...

N

Element N

N+1

Element End

3.2.6.         Configuration Response frame format

Table 10 Frame body of Configuration Response

Order

Information

Note

1

User Id

2 bytes octets

2

Status code

2 bytes octets

3.2.7.         Connection frame format

Table 11 Frame body of Connect Request

Order

Information

Note

1

Connection transaction sequence number

2 bytes octets

2

Status code

The information only present in certain connection frames as defined in following table.

3

User Id

4

User name

5

Password

 

Table 12 Presence of user name information

Connection transaction sequence number

Status code

User Id

User name

Password

1

Reserved 0

Reserved 0

Present

Present

2

Status

Present

Not present

Not present

3

Reserved 0

Present

Present

Not present

4

Status

Present

Not present

Not present

 

3.2.8.         File Open Request frame format

Table 13 Frame body of File Open Request

Order

Information

Note

1

User Id

2 bytes octets

2

Attribute

A character

‘w’ for reading

‘r’ for writing

3

File Name

A null end string

N bytes octets

3.2.9.         File Open Response frame format

Table 14 Frame body of File Open Response

Order

Information

Note

1

User Id

2 bytes octets

2

Status Code

2 bytes octets

2

File Id

2 bytes octets

3

Size

Meaning the file size when reading

Or meaning the limited maximum file size when writing

4 bytes octets

3.2.10.   File Close Request frame format

Table 15 Frame body of File Close Request

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3.2.11.   File Close Response frame format

Table 16 Frame body of File Close Response

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3

Status Code

2 bytes octets

3.2.12.   File Write Request frame format

Table 17 Frame body of File Write Request

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3

Bytes to write

2 bytes octets

4

Byte Offset

Byte offset from the first byte of file

4 bytes octets

5

Data to write

Length of data define in Bytes to write field.

N bytes octets

3.2.13.   File Write Response frame format

Table 18 Frame body of File Write Response

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3

Status Code

2 bytes octets

4

Bytes Written

2 bytes octets

5

Bytes Offset

4 bytes octets

3.2.14.   File Read Request frame format

Table 19 Frame body of File Read Request

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3

Bytes to read

2 bytes octets

4

Byte Offset

Byte offset from the first byte of file

4 bytes octets

 

3.2.15.   File Read Response frame format

Table 20 Frame body of File Read Response

Order

Information

Note

1

User Id

2 bytes octets

2

File Id

2 bytes octets

3

Status Code

2 bytes octets

4

Bytes to Read

2 bytes octets

5

Byte Offset

Byte offset from the first byte of file

4 bytes octets

6

Data

Length of data define in Bytes to read field.

N bytes octets

 

3.2.16.   User Defined Request frame format

Table 21 Frame body of File Read Response

Order

Information

Note

1

User Id

2 bytes octets

2

Body Length

2 bytes octets

3

Body

User defined N bytes octets

 

 

3.2.17.   User Defined Response frame format

Table 22 Frame body of File Read Response

Order

Information

Note

1

User Id

2 bytes octets

2

Status

2 bytes octets

3

Return Length

2 bytes octets

4

Return Buffer

N bytes octets

 

 

 

 

 

 

 

3.3.      Frame body components 3.3.1.         User Id field

The User Id information is a 2 bytes number given from server.

3.3.2.         Status Code field

The Status Code is a 2 bytes octets. The failure cause codes are defined in following table:

Table 23 Status Codes

Status code

Meaning

0

Successful

1

Unspecified failure

2

Timeout

3

Busy

4

Invalid user in connection request frame

5

The connection request is rejected from server.

6

Disconnection

7

Invalid request parameter

8

Failure cause by buffer overflow

9

 

 

3.3.3.         Manufacturer element

Table 24 Manufacturer element format

Element ID

Element Length

Manufacturer name

2 bytes

1 byte

N bytes

3.3.4.         Product Name element 3.3.5.         Model Name element 3.3.6.         Element IDs

Table 25 Element ID field description

Element Class

Element Number

Bit 15 – bit 12

Bit 11 – bit 0

 

Table 26 Element class description

Element Class

Description

0

General Information

1

Wireless LAN1 Information

 

 

 

The set of valid elements is defined in following table:

4.    Routines and Variables 4.1.      Support routines provided by the LIAPP

STATUS LIAPP_Initialize(char *DeviceId, );

STATUS LIAPP_Indication(char *DeviceId, char *Frame, int Length);

STATUS LIAPP_Browse(char *Manufacturer, char *Product, char *Model, int timeout);

STATUS LIAPP_Inquiry(char *ElementIdList, int timeout);

STATUS LIAPP_Configuration(char *ElementList, int timeout);

STATUS LIAPP_StartUpload(void);

STATUS LIAPP_Upload(char Buffer2Upload, long Bytes2Upload, long timeout);

STATUS LIAPP_SendEndUpload(void);

STATUS LIAPP_StartDownload(void);

STATUS LIAPP_Download(char Buffer2Download, long Bytes2Download, short timeout);

STATUS LIAPP_SendEndDownload(void);

STATUS LIAPP_Action(int ActionId, short timeout);

4.2.      Support routines provided by Utility Interface

TIMERID SetTimer(void * TimeoutCall, int timeout);

BOOLEAN StopTimer(TIMERID TimerId);

BOOLEAN LIAPP_Validuser(char *username, char *password);

BOOLEAN LIAPP_Send(char *DeviceId, char *Frame, int length);

BOOLEAN LIAPP_Write(char *username, char *destination, char *source, int length);

BOOLEAN LIAPP_Read(char *username, char *destination, char *source, int length);

BOOLEAN LIAPP_SetElement(int ElementId, int ElementLength, char *ElementValue);

BOOLAEN LIAPP_GetElement(int ElementId, int MaxElementLength, char *ElementValue);

Void LIAPP_NotifyEndUpload(void);

Void LIAPP_NotifyEndDownload(void);

4.3.      Variables provided by LIAPP

Char LIAPP_MyDeviceId[16];

Char LIAPP_State;

Char LIAPP_Prestate;

Char LIAPP_RetryLimit;

Char LIAPP_username;

Char LIAPP_DeviceIdofConnection;

4.4.      Variables provided by Utility Interface

MACRO LIAPP_WaitEvent(Event, timeout)

Event LIAPP_InquiryCompleteEvent

Event LIAPP_ConfigurationCompleteEvent

Event LIAPP_StartUploadCompleteEvent

Event LIAPP_StartDownloadCompleteEvent

Event LIAPP_UploadCompleteEvent

Event LIAPP_DownloadCompleteEvent

Event LIAPP_EndUploadCompleteEvent

Event LIAPP_EndDownloadCompleteEvent

 

 

 

 

 

 

 

 

 

 

本文地址:http://com.8s8s.com/it/it34106.htm