Skip to content

Update RNBluetoothEscposPrinter.m #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ios/RNBluetoothEscposPrinter.m
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,34 @@ -(void) textPrint:(NSString *) text
pendingResolve = resolve;
[RNBluetoothManager writeValue:toPrint withDelegate:self];
}

//nMode1:27,
//nMode2:112,
//nMode3:48,
//nMode4:55
//nMode5:121
RCT_EXPORT_METHOD(openDrawer:(NSString *) str
mode1:(NSInteger) nMode1
mode2:(NSInteger) nMode2
mode3:(NSInteger) nMode3
mode4:(NSInteger) nMode4
mode5:(NSInteger) nMode5
andResolver:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject)
{
NSMutableData *toPrint = [[NSMutableData alloc] init];
int8_t * command = malloc(5);
command[0] = nMode1;
command[1] = nMode2;
command[2] = nMode3;
command[3] = nMode4;
command[4] = nMode5;
[toPrint appendBytes:command length:5];
pendingReject = reject;
pendingResolve = resolve;
[RNBluetoothManager writeValue:toPrint withDelegate:self];

}
// L:1,
//M:0,
//Q:3,
Expand Down