Secondary display API: Difference between revisions

From wizarPOS
(Created page with "== Functions == The calling sequence is open>ctrl_devs/write_picture>close === open === void* customer_display_open(in...")
 
No edit summary
Line 9: Line 9:
{|
{|
|-
|-
| ''pErrorCode'' || if out is null, can not open, else, the out is the handler
| ''pErrorCode'' || int* || if out is null, can not open, else, the out is the handler
|}
|}
'''Returns'''
'''Returns'''
Line 21: Line 21:
{|
{|
|-
|-
| ''nHandle'' || Handle of this device, returned from open
| ''nHandle'' || int || Handle of this device, returned from open
|}
|}
'''Returns'''
'''Returns'''
Line 34: Line 34:
{|
{|
|-
|-
| ''nHandle'' || Handle of this device, returned from open
| ''nHandle'' || int || Handle of this device, returned from open
|-
|-
| ''nCmd'' || Control command
| ''nCmd'' || int || Control command
|-
|-
| ''nValue'' || Value of control command
| ''nValue'' || int || Value of control command
|}
|}
{| class="wikitable"
{| class="wikitable"
Line 65: Line 65:
{|
{|
|-
|-
| ''nHandle'' || Handle of this device, returned from open
| ''nHandle'' || int || Handle of this device, returned from open
|-
|-
| ''nXcoordinate'' || X cordinate
| ''nXcoordinate'' || unsigned int || X cordinate
|-
|-
| ''nYcoordinate'' || Y cordinate
| ''nYcoordinate'' || unsigned int || Y cordinate
|-
|-
| ''nWidth'' || width
| ''nWidth'' || unsigned int || width
|-
|-
| ''nHeight'' || Height
| ''nHeight'' || unsigned int || Height
|-
|-
| ''pData'' || All point data
| ''pData'' || unsigned char* || All point data
|-
|-
| ''nDataLength'' || Point data length
| ''nDataLength'' || unsigned int || Point data length
|}
|}
'''Returns'''
'''Returns'''


The result code, >= 0, success; <0 [[Error_code|error code]].
The result code, >= 0, success; <0 [[Error_code|error code]].

Revision as of 07:55, 19 April 2018

Functions

The calling sequence is open>ctrl_devs/write_picture>close

open

void* customer_display_open(int* pError)

Open the CustomerDisplay device. This operation should be used before other operations.

Parameters

pErrorCode int* if out is null, can not open, else, the out is the handler

Returns

close

 int customer_display_close(int nHandle)

Close the CustomerDisplay device opened before. The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.

Parameters

nHandle int Handle of this device, returned from open

Returns

The result code, >= 0, success; <0 error code.

ctrl_devs

 int customer_display_ctrl_devs(int nHandle, int nCmd, int nValue)

Use the function of the CustomerDisplay, such as set background, display default screen, open or close led, buzzer beep and so on.

Parameters

nHandle int Handle of this device, returned from open
nCmd int Control command
nValue int Value of control command
nCmd nValue
0x04:set background. RED :0x001F;BLACK:0X0000;YELLOW:0X07FF;BLUE:0XF800;GRAY0:0XCE9A.
0x05:display default screen. 0
0x06:led. 1:open led; 0:close led.
0x07:buzzer. 0

Returns

The result code, >= 0, success; <0 error code.

write_picture

 int customer_display_write_picture_data(int nHandle, unsigned int nXcoordinate, unsigned int nYcoordinate,unsigned int nWidth, unsigned int nHeight ,unsigned char* pData, unsigned int nDataLength)

Write picture point data(one point to 4 bytes in ARGB8888). You need firstly convert a Bitmap to point data.


Parameters

nHandle int Handle of this device, returned from open
nXcoordinate unsigned int X cordinate
nYcoordinate unsigned int Y cordinate
nWidth unsigned int width
nHeight unsigned int Height
pData unsigned char* All point data
nDataLength unsigned int Point data length

Returns

The result code, >= 0, success; <0 error code.