{"_id":"@awarns/wifi","_rev":"1-c2baae342d8f35d76d1fccb1bd3449bc","name":"@awarns/wifi","dist-tags":{"alpha":"1.0.0-alpha.16","latest":"1.0.0"},"versions":{"1.0.0-alpha.16":{"name":"@awarns/wifi","version":"1.0.0-alpha.16","description":"Add a plugin description","main":"index","typings":"index.d.ts","nativescript":{"platforms":{"ios":"6.0.0","android":"6.0.0"}},"repository":{"type":"git","url":"git+ssh://git@github.com/GeoTecINIT/awarns-framework.git"},"keywords":["NativeScript","JavaScript","TypeScript","iOS","Android"],"author":{"name":"Alberto González Pérez","email":"algonzal@uji.es"},"bugs":{"url":"http://github.com/GeoTecINIT/awarns-framework/issues"},"license":"Apache-2.0","homepage":"http://github.com/GeoTecINIT/awarns-framework","bootstrapper":"@nativescript/plugin-seed","dependencies":{"@awarns/core":"^1.0.0-alpha.11","nativescript-context-apis":"^4.1.0","rxjs":"^7.5.5"},"gitHead":"b6f6eb8530d0fc3a20503e988e6df488ea03e681","_id":"@awarns/wifi@1.0.0-alpha.16","_nodeVersion":"16.13.1","_npmVersion":"8.3.2","dist":{"integrity":"sha512-ETFrEfrg64V1sVYQh5LbbJYJDJ/+o602Ch/nAN25dpMloF0yxCOLUAZrOFs329D5FSbL1bV4b04D0sUyrxKrtA==","shasum":"40fffdb76f2e4bb935b4b716bdaf95c52ce3a828","tarball":"https://registry.npmjs.org/@awarns/wifi/-/wifi-1.0.0-alpha.16.tgz","fileCount":22,"unpackedSize":10852,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTVDYBtQJYqThjV7qvSoYBKqv747sOcBHFxz/UFj6L6gIhAN1XMXl2Cl06CjpreLJ3Xnlre03/clxtIEqI8G0Ts9vD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilNHkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIkhAAjDVLgJqZxZl1ZrlgZ7boe+26q7m7NK56xTvk1FbKPIBy+FgI\r\nsFa2upLb53jn13XzIAo0xqmbDpH2ef7/9kfAhLDO/jBOqb+fZBQdoguHUtPT\r\nsmjs4ca+vVUwVU2T9SwfFSZoxPhLhgPCsKPFMyrDBRKmN1FOI62gmppoiiYr\r\n0Xh20SLrd+ybVJRDFU83Oc4x4CMM3GSgMMTFq47oSCgsRbMB8ftwzfU3qjmg\r\nlC8NjCeE/rQ1iT2QrAm+cKIy7tLDKIzzTsAeQnJQ+Ic5W1s3TXVuU7stDvxd\r\n5vLF+ZyHDnxBTxko9aBSKKcYXTaNoD3QkzoqkRDEXFk9uljvjnHcGW9l7NyJ\r\nTbNf6kBYYdfa3FLyhIO8nFMB5y9qAXQoqipTUkTht+z7+w3qpyaEcV0fqKSl\r\n6Hg1Q71PS+g8GBou5t9JYBTwv953iGmu3nDzTi7vr9p6NW3ZNY7P8/oTh51g\r\nKlklyvt73tBn3Q3MsLp9+eM42Kpj3nHxr0JLCTIGsSpjOBPxyC/LYRc0hu/j\r\n7V048pIUWiyr7KmWnURb8vpnNQNj/wQspzpTAA/rUjS/jo7ujA5D+XrXSZq7\r\n+WYz5DdBdBsM7el7lmj1swQWpRfP6XyhYwn3mKWhhuf9fl1z7K42APxZnI5u\r\nvLTyoAeDbH9C3ssbqQgOYsWJUB1BtBUCLRs=\r\n=BfNb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"albertogonper","email":"alberto.gonzalez95@gmail.com"},"directories":{},"maintainers":[{"name":"matey","email":"matey@uji.es"},{"name":"albertogonper","email":"alberto.gonzalez95@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wifi_1.0.0-alpha.16_1653920228494_0.9620376606554677"},"_hasShrinkwrap":false},"1.0.0":{"name":"@awarns/wifi","version":"1.0.0","description":"AwarNS Framework package that allows to scan for nearby Wi-Fi access points ","main":"index","typings":"index.d.ts","nativescript":{"platforms":{"ios":"6.0.0","android":"6.0.0"}},"repository":{"type":"git","url":"git+ssh://git@github.com/GeoTecINIT/awarns-framework.git"},"keywords":["NativeScript","JavaScript","TypeScript","Android","Context Awareness","Awareness","AwarNS","Indoor","Fingerprinting","Wi-Fi"],"authors":[{"name":"Alberto González Pérez","email":"algonzal@uji.es"},{"name":"Miguel Matey Sanz","email":"matey@uji.es"}],"bugs":{"url":"http://github.com/GeoTecINIT/awarns-framework/issues"},"license":"Apache-2.0","homepage":"http://github.com/GeoTecINIT/awarns-framework","bootstrapper":"@nativescript/plugin-seed","dependencies":{"@awarns/core":"^1.0.0","nativescript-context-apis":"^4.1.0","rxjs":"^7.5.5"},"gitHead":"98c5bd4617e78457909f81c077501ab626ff35c7","_id":"@awarns/wifi@1.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.3.2","dist":{"integrity":"sha512-6/7ij7l6pPUeUckssTK2tGqc1/tUfn7Q+gMNh9FkzYznnYGdu3GVDZRxs0PAO6JP4aAO3Ccu70rmEx9Qwb+gYw==","shasum":"2bdd99ef605b9439d8663baee87f1be501b6b223","tarball":"https://registry.npmjs.org/@awarns/wifi/-/wifi-1.0.0.tgz","fileCount":22,"unpackedSize":21198,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7X5OtIffyetxso9hFz6Ybi/ShwdjxVWoUEyVZfH+NlAiA+duuK4aUZq59NLJGacGj9E+09HntF+fb8HoM9mAxeLg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisfsWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUEQ/+JBKbRn/V3eT/xs7OelZpXf3/ZJkY3h8JLdM+1+OcBiQFTXNr\r\n3C+i4TMg5rhxKB3NtP8o9tY7hT1tDgbBBmUWxU53gALzDWuEmN3kajJVTDaO\r\nFjB4H5cZKJW1yAwosFewFj0yk5s2hmclsk04MTJSLGK7WkJLkMB7fx/zi6TB\r\nPP4ngH5uyjvQX9tWFHw1Q1fsjD+4W99P69hTCgJOx7JQ3SKkS23mn+2mx+Tf\r\nxtDm0k+SKUlnq7hdSStp+sSagGX3ES9H9x8TOX8oM9dgywbRRwN28gzz+vtw\r\nJIUdOuY6ozSejH4oegVkZq18k5m2Q/7g0eBhBzedcRTwuigANXz3ZrvxaWwR\r\n6nA26p4MDxj5eR4ld4DudjI8Ih3GbdYf4KNBogfdognSCpRfhByC9boB/6cc\r\nQ/WX2kJoLBb/ZHnoi9Zp42OVTQqVzU1Vt8k4XGv8agCvOEh4Cl+qzyktZbuO\r\njY/crsZ5pjYFx/79TIsTUr5W6dtQXKiEALVf5UdZe5kG1UWU/tmN55BxewHI\r\n2Kbic45gx9wvA95LGeK9+4u7c83w20l/vPr+FLjftLLGdBIR09S+azfBUzfk\r\nYNpxjdgoaIvu/jqKbLl5Hh3QNAxAsOCJux9oOsB5+JrmzSsMBwz4kysWsrfz\r\nhvhBdHU/5LN8cpNMY5n/9skC4qzf9PYK8PE=\r\n=ShOT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"albertogonper","email":"alberto.gonzalez95@gmail.com"},"directories":{},"maintainers":[{"name":"matey","email":"matey@uji.es"},{"name":"albertogonper","email":"alberto.gonzalez95@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wifi_1.0.0_1655831318500_0.7492606300352456"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-30T14:17:08.416Z","1.0.0-alpha.16":"2022-05-30T14:17:08.648Z","modified":"2022-06-21T17:08:38.835Z","1.0.0":"2022-06-21T17:08:38.704Z"},"maintainers":[{"name":"matey","email":"matey@uji.es"},{"name":"albertogonper","email":"alberto.gonzalez95@gmail.com"}],"description":"AwarNS Framework package that allows to scan for nearby Wi-Fi access points ","homepage":"http://github.com/GeoTecINIT/awarns-framework","keywords":["NativeScript","JavaScript","TypeScript","Android","Context Awareness","Awareness","AwarNS","Indoor","Fingerprinting","Wi-Fi"],"repository":{"type":"git","url":"git+ssh://git@github.com/GeoTecINIT/awarns-framework.git"},"bugs":{"url":"http://github.com/GeoTecINIT/awarns-framework/issues"},"license":"Apache-2.0","readme":"# @awarns/wifi\n![npm (scoped)](https://img.shields.io/npm/v/@awarns/wifi)\n![npm](https://img.shields.io/npm/dm/@awarns/wifi)\n\nThis module includes tasks to obtain information regarding nearby Wi-Fi access points (APs). This is useful to assess the existence of concrete access points nearby. Also, to build custom indoor localization and positioning systems based on Wi-Fi.\n\nThis plugin acts as a wrapper on top of the [nativescript-context-apis](https://github.com/GeoTecINIT/nativescript-context-apis) plugin (from the same authors), offering Wi-Fi scanning tasks. Scan for nearby Wi-Fi APs even in background.\n\nInstall the plugin using the following command line instruction:\n\n```bash\nns plugin add @awarns/wifi\n```\n## Usage\n\nAfter installing and setting up this plugin, you'll have access to two different tasks to scan for Wi-Fi APs seen nearby. The result, will be a [WifiScan](#wifiscan) record, described below.\n\n### Tasks\n\n| Task name                                                       | Description                                                                                                                                                                                                     |\n|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`acquirePhoneWifiScan`](#acquire-a-single-wi-fi-scan)          | Allows to perform a single Wi-Fi scan for a given amount of time                                                                                                                                                |\n| [`acquireMultiplePhoneWifiScan`](#acquire-wi-fi-scans-in-batch) | Allows to repeatedly perform Wi-Fi scans. Scans will happen for as long as there is execution time remaining (3 minutes max. or shortly before the next time-scheduled task execution, whatever occurs earlier) |\n\n> **Note**: All the tasks require **fine location permission and active Wi-Fi radio** for their execution. Each task will automatically request what is missing during framework's initialization\n\n#### Acquire a single Wi-Fi scan\n\nTo register this task for its use, you just need to import it and call its generator function inside your application's task list:\n\n```ts\nimport { Task } from '@awarns/core/tasks';\nimport { acquirePhoneWifiScanTask } from '@awarns/wifi';\n\nexport const demoTasks: Array<Task> = [\n    acquirePhoneWifiScanTask(/* optional */ { ensureIsNew: true, timeout: 15000 }),\n];\n```\nTask generator parameters:\n\n| Name           | Type            | Description                                                                                                                                                                                                                                                                                |\n|----------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ensureIsNew`  | `boolean`       | Make sure that the resulting Wi-Fi scan is up-to-date. A value of `true` ensures [Android Wi-Fi scanning restrictions](https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling) are met, thus the reported value is always new. The default value is `true` |\n| `timeout`      | `number`        | The maximum time, in milliseconds, to be spent scanning for nearby Wi-Fi APs. The default value is `15000` (15s)                                                                                                                                                                           |\n\nTask output events:\n\n- [`wifiScanAcquired`](#events)\n\n> Example usage in the application task graph:\n> ```ts\n> on(\n>   'startEvent',\n>   run('acquirePhoneWifiScan')\n>     .every(1, 'minutes')\n>     .cancelOn('stopEvent')\n> );\n> \n> on('wifiScanAcquired', run('writeRecords'));\n>```\n> **Note**: To use the `writeRecords` task, the persistence package must be installed and configured. See [persistence package docs](../persistence/README.md).\n\n#### Acquire Wi-Fi scans in batch\n\nTo register this task for its use, you just need to import it and call its generator function inside your application's task list:\n\n```ts\nimport { Task } from '@awarns/core/tasks';\nimport { acquireMultiplePhoneWifiScanTask } from '@awarns/wifi';\n\nexport const demoTasks: Array<Task> = [\n  acquireMultiplePhoneWifiScanTask(/* optional */ { ensureIsNew: true, timeout: 15000 }),\n];\n```\nTask generator parameters:\n\n| Name          | Type      | Description                                                                                                                                                                                                                                                                                    |\n|---------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ensureIsNew` | `boolean` | Make sure that the resulting Wi-Fi scans are up-to-date. A value of `true` ensures [Android Wi-Fi scanning restrictions](https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling) are met, thus the reported values are always new. The default value is `true` |\n| `timeout`     | `number`  | The maximum time to be spent performing each individual Wi-Fi scan. The default value is `15000` (15s)                                                                                                                                                                                         |\n\nTask output events:\n\n- [`wifiScanAcquired`](#events)\n\n> Example usage in the application task graph:\n> ```ts\n> on(\n>   'startEvent',\n>   run('acquireMultiplePhoneWifiScan', { \n>      maxInterval: 25000 \n>      /* \n>         (Optional, mandatory if ensureIsNew=true) Maximun interval between scans, unlimited by default. \n>         \n>         If ensureIsNew=true, the value must ensure that a maximum of 2 scans are being collectd every minute. \n>         \n>         For example, here the task will be executed every 1 minute, which means it will have ~55s to run. \n>         With 25s between scans we meet the OS restrictions and have enought time to collect 2 Wi-Fi fingerprints. \n>      */ \n>   })\n>     .every(1, 'minutes')\n>     .cancelOn('stopEvent')\n> );\n> \n> on('wifiScanAcquired', run('writeRecords'));\n>```\n> **Note**: To use the `writeRecords` task, the persistence package must be installed and configured. See [persistence package docs](../persistence/README.md).\n\n### Events\n\n| Name               | Payload                                                    | Description                                                          |\n|--------------------|------------------------------------------------------------|----------------------------------------------------------------------|\n| `wifiScanAcquired` | [<code>WifiScan &vert; Array\\<WifiScan></code>](#wifiscan) | Indicates that one or more new Wi-Fi scan results have been acquired |\n\n### Records\n\n#### WifiScan\n\n| Property    | Type                                                                               | Description                                                                                                                                                                                                                  |\n|-------------|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id`        | `string`                                                                           | Record's unique id                                                                                                                                                                                                           |\n| `type`      | `string`                                                                           | Always `wifi-scan`                                                                                                                                                                                                           |\n| `change`    | `Change`                                                                           | Always `none`. Scan results are returned as a whole. Intermediate results are not reported                                                                                                                                   |\n| `timestamp` | `Date`                                                                             | The local time when the scan was completed                                                                                                                                                                                   |\n| `isNew`     | `boolean`                                                                          | Indicates if the results of the scan are cached. This can only be `false` when using `ensureIsNew=false` option during the scans                                                                                             |\n| `seen`      | [`Array<WifiApInfo>`](https://github.com/GeoTecINIT/nativescript-context-apis#api) | The Wi-Fi APs seen during the scan. The list can be empty. For details on the properties of the WifiApInfo object, see [context-apis API docs](https://github.com/GeoTecINIT/nativescript-context-apis#api) section on Wi-Fi |\n\n\n## License\n\nApache License Version 2.0\n","readmeFilename":"README.md"}