-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(added): add docs for addText, disconnect, addFeedLine methods
- Loading branch information
Showing
4 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## addFeedLine | ||
|
||
Adds a paper-feed-by-line command to the command buffer. | ||
|
||
### Parameters | ||
|
||
#### line *(optional)* | ||
|
||
- `number` | ||
|
||
Specifies the paper feed amount (in lines). | ||
|
||
| **Value** | **Description** | **Default** | | ||
| --- | --- | --- | | ||
| 0 to 255 | Paper feed amount (in lines) | 1 | | ||
|
||
### Returns | ||
|
||
`Promise<void>` | ||
|
||
### Errors | ||
|
||
| **Error status** | **Description** | | ||
| --- | --- | | ||
| ERR_PARAM | An invalid parameter was passed. | | ||
| ERR_TIMEOUT | Failed to communicate with the devices within the specified time. | | ||
| ERR_MEMORY | Necessary memory could not be allocated. | | ||
|
||
### Supplementary explanation | ||
|
||
|
||
- Calling this API causes the printer positioned at "the beginning of the line." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## addText | ||
|
||
Adds a character print command to the command buffer. | ||
|
||
### Parameters | ||
|
||
#### text | ||
|
||
- `string` | ||
|
||
Specifies the string to print. | ||
Use the following escape sequences for a horizontal tab and line feed. | ||
|
||
| **String** | **Description** | | ||
| --- | --- | | ||
|`\t` | Horizontal tab (HT)| | ||
| `\n` | Line feed (LF) | ||
| `\\` | Backslash | | ||
|
||
### Returns | ||
|
||
`Promise<void>` | ||
|
||
### Errors | ||
|
||
| **Error status** | **Description** | | ||
| --- | --- | | ||
| ERR_PARAM | An invalid parameter was passed. | | ||
| ERR_TIMEOUT | Failed to communicate with the devices within the specified time. | | ||
| ERR_MEMORY | Necessary memory could not be allocated. | | ||
|
||
### Supplementary explanation | ||
|
||
|
||
- To print data other than text after printing text, feed a line or page. | ||
A line which does not end with a line feed will be discarded as unfixed data by the next [sendData](./sendData.md). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## disconnect | ||
|
||
Ends communication with the printer. | ||
|
||
### Returns | ||
|
||
`Promise<void>` | ||
|
||
### Errors | ||
|
||
| **Error status** | **Description** | | ||
| --- | --- | | ||
| ERR_MEMORY | Necessary memory could not be allocated. | | ||
| ERR_FAILURE | An unknown error occurred. | | ||
| ERR_PROCESSING | Could not run the process. | | ||
| ERR_DISCONNECT | Failed to disconnect the device. Tried to terminate communication with a printer during reconnection process. | | ||
|