Constructors
constructor
- new Xmodem(sendRaw): Xmodem
Properties
Private
counter
counter: number
Private
rxBuffer
rxBuffer: Uint8Array[]
Private
sendRaw
sendRaw: XmodemProps
Private
textEncoder
textEncoder: TextEncoder
Private
txBuffer
txBuffer: Uint8Array[]
Methods
clear
- clear(): void
Returns void
downloadFile
- downloadFile(filename): Promise<number>
Returns Promise<number>
handlePacket
- handlePacket(packet): Promise<number>
Returns Promise<number>
sendCommand
- sendCommand(command, buffer?, sequence?, crc16?): Promise<number>
Parameters
- command: XModem_Control
Optional
buffer: Uint8ArrayOptional
sequence: numberOptional
crc16: number
Returns Promise<number>
uploadFile
- uploadFile(filename, data): Promise<number>
Parameters
- filename: string
- data: Uint8Array
Returns Promise<number>
validateCrc16
- validateCrc16(packet): boolean
Returns boolean