@haroldtran/react-native-pax 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -66,13 +66,15 @@ class PaxPosLinkModule(
|
|
|
66
66
|
@ReactMethod
|
|
67
67
|
fun initPOSLink(
|
|
68
68
|
ip: String,
|
|
69
|
+
port: String?,
|
|
70
|
+
timeout: Int?,
|
|
69
71
|
promise: Promise,
|
|
70
72
|
) {
|
|
71
73
|
val tcpSetting =
|
|
72
74
|
TcpSetting().apply {
|
|
73
75
|
this.ip = ip
|
|
74
|
-
this.port = PaxPosConstant.PORT
|
|
75
|
-
this.timeout = PaxPosConstant.TIMEOUT
|
|
76
|
+
this.port = port ?: PaxPosConstant.PORT
|
|
77
|
+
this.timeout = timeout ?: PaxPosConstant.TIMEOUT
|
|
76
78
|
}
|
|
77
79
|
Log.i("TcpSetting", "tcpSetting info: ip=$ip, port=${tcpSetting.port}, timeout=${tcpSetting.timeout}")
|
|
78
80
|
val map = Arguments.createMap()
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -38,10 +38,16 @@ const PaxPosLink = isAndroid
|
|
|
38
38
|
/**
|
|
39
39
|
* Initializes the POSLink connection.
|
|
40
40
|
* @param {string} [ip] - The IP address of the POS device.
|
|
41
|
+
* @param {object} [options] - Optional parameters.
|
|
42
|
+
* @param {string} [options.port] - The port number of the POS device.
|
|
43
|
+
* @param {number} [options.timeout] - The timeout value for the connection.
|
|
41
44
|
* @returns {Promise<PaxInitModel>} A promise resolving to the initPOSLink result.
|
|
42
45
|
*/
|
|
43
|
-
export function initPOSLink(
|
|
44
|
-
|
|
46
|
+
export function initPOSLink(
|
|
47
|
+
ip: string,
|
|
48
|
+
options?: { port?: string; timeout?: number }
|
|
49
|
+
): Promise<PaxInitModel> {
|
|
50
|
+
return PaxPosLink.initPOSLink(ip, options?.port, options?.timeout);
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
/**
|