### Install palm-sync Package Source: https://github.com/jichu4n/palm-sync/blob/master/README.md Install the palm-sync library using npm. This is the first step to using the library in your project. ```bash npm install --save palm-sync ``` -------------------------------- ### Create a Conduit to List Databases Source: https://github.com/jichu4n/palm-sync/blob/master/README.md An example TypeScript conduit that connects to a Palm OS device and lists all databases. Ensure you have the necessary imports from 'palm-sync'. ```typescript // ./src/list-dbs.ts import { DlpConnection, DlpReadDBListFlags, DlpReadDBListReqType, } from 'palm-sync'; export async function run(dlpConnection: DlpConnection) { const readDbListResp = await dlpConnection.execute( DlpReadDBListReqType.with({ srchFlags: DlpReadDBListFlags.with({ram: true, multiple: true}), }) ); const dbNames = readDbListResp.dbInfo.map(({name}) => name); console.log(dbNames.join('\n')); } ``` -------------------------------- ### createSyncServer Source: https://github.com/jichu4n/palm-sync/blob/master/README.md Creates a SyncServer instance. This server listens for incoming HotSync connections, interfaces with hardware, sets up the transport protocol stack, and passes control to a configured conduit. Use `start()` and `stop()` to manage the server lifecycle, and subscribe to its `connect` and `disconnect` events. ```APIDOC ## createSyncServer() ### Description Creates a SyncServer instance for managing HotSync connections. It handles hardware interfacing, protocol stack setup, and conduit delegation. The server's lifecycle can be managed with `start()` and `stop()`, and connection events can be subscribed to. ### Method N/A (Function call) ### Endpoint N/A (Function call) ### Parameters N/A (Function call) ### Request Example N/A (Function call) ### Response #### Success Response - **SyncServer instance** - An object representing the sync server. #### Response Example N/A (Function call) ``` -------------------------------- ### createSyncServerAndRunSync Source: https://github.com/jichu4n/palm-sync/blob/master/README.md A convenience function to execute a single HotSync operation. It creates and starts a SyncServer instance, runs a specified conduit, and then stops the server. ```APIDOC ## createSyncServerAndRunSync() ### Description Convenience function to perform a single HotSync operation. It automates the process of creating, starting, running a conduit with, and stopping a SyncServer. ### Method N/A (Function call) ### Endpoint N/A (Function call) ### Parameters N/A (Function call) ### Request Example N/A (Function call) ### Response #### Success Response N/A (Function call - typically performs an action and returns status or results) #### Response Example N/A (Function call) ``` -------------------------------- ### Run Conduit with CLI Source: https://github.com/jichu4n/palm-sync/blob/master/README.md Execute a custom conduit using the palm-sync CLI. This example shows how to build the TypeScript conduit and then run it via USB. Options for serial and network connections are also provided. ```bash # Run tsc to produce ./dist/list-dbs.js npm run build # Wait for HotSync connection over USB and run specified conduit. # - For serial, use `--serial /dev/ttyXXX` (`--serial COMn` on Windows) # - For network HotSync (port 14238), use `--net` # - For serial-over-network (POSE and other emulators), use `--serial:net` # to listen on port 6416 ./node_modules/.bin/palm-sync run --usb ./dist/list-dbs.js ``` -------------------------------- ### List Serial Devices on Linux Source: https://github.com/jichu4n/palm-sync/blob/master/docs/connecting-palm-os-devices.md Use this command to identify the serial device name for your serial-to-USB adapter on Linux. The output shows an example device name and its group permissions. ```bash $ ls -l /dev/ttyUSB* crw-rw---- 1 root uucp 188, 0 Jul 14 22:08 /dev/ttyUSB0 ``` -------------------------------- ### List Serial Devices on macOS Source: https://github.com/jichu4n/palm-sync/blob/master/docs/connecting-palm-os-devices.md Use this command to identify the serial device name for your serial-to-USB adapter on macOS. The output shows example device names. ```bash $ ls -l /dev/tty.* crw-rw-rw- 1 root wheel 9, 2 Jul 4 00:48 /dev/tty.Bluetooth-Incoming-Port crw-rw-rw- 1 root wheel 9, 4 Jul 14 22:24 /dev/tty.usbserial-2240 crw-rw-rw- 1 root wheel 9, 0 Jul 4 00:47 /dev/tty.wlan-debug ``` -------------------------------- ### Reload udev Rules on Linux Source: https://github.com/jichu4n/palm-sync/blob/master/docs/connecting-palm-os-devices.md After adding udev rules for Palm OS devices, run this command to apply the changes without rebooting. This allows non-root users to access USB devices. ```bash sudo udevadm control --reload-rules && sudo udevadm trigger ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.