1This directory contains code and tools for generating and debugging binary 2satellite s2 file. 3 4Directory structure 5= 6 7`s2storage` 8- `src/write` S2 write code used by tools to write the s2 cells into a 9 binary file. This code is also used by `TeleServiceTests`. 10- `src/readonly` S2 read-only code used by the above read-write code and the class 11 `S2RangeSatelliteOnDeviceAccessController`. 12 13`tools` 14- `src/main` Contains the tools for generating binary satellite s2 file, and tools 15 for dumping the binary file into human-readable format. 16- `src/test` Contains the test code for the tools. 17 18Run unit tests 19= 20- Build the tools and test code: Go to the tool directory (`packages/services/Telephony/tools/ 21 satellite`) in the local workspace and run `mm`, e.g., 22- Run unit tests: `$atest SatelliteToolsTests` 23 24Data file generate tools 25= 26 27`satellite_createsats2file` 28- Runs the `satellite_createsats2file` to create a binary satellite S2 file from a 29 list of S2 cells ID. 30- Command: `$satellite_createsats2file --input-file <s2cells.txt> --s2-level <12> 31 --is-allowed-list <true> --output-file <sats2.dat>` 32 - `--input-file` Each line in the file contains a `unsigned-64bit` number which represents 33 the ID of a S2 cell. 34 - `--s2-level` The S2 level of all the cells in the input file. 35 - `--is-allowed-list` Should be either `trrue` or `false` 36 - `true` The input file contains a list of S2 cells where satellite services are allowed. 37 - `false` The input file contains a list of S2 cells where satellite services are disallowed. 38 - `--output-file` The created binary satellite S2 file, which will be used by 39 the `SatelliteAccessController` module in determining if satellite communication 40 is allowed at a location. 41- Build the tools: Go to the tool directory (`packages/services/Telephony/tools/satellite`) 42 in the local workspace and run `mm`. 43- Example run command: `$satellite_createsats2file --input-file s2cells.txt --s2-level 12 44 --is-allowed-list true --output-file sats2.dat` 45 46Debug tools 47= 48 49`satellite_createsats2file_test` 50- Create a test binary satellite S2 file with the following ranges: 51 - [(prefix=0b100_11111111, suffix=1000), (prefix=0b100_11111111, suffix=2000)) 52 - [(prefix=0b100_11111111, suffix=2000), (prefix=0b100_11111111, suffix=3000)) 53 - [(prefix=0b101_11111111, suffix=1000), (prefix=0b101_11111111, suffix=2000)) 54- Run the test tool: `satellite_createsats2file_test /tmp/foo.dat` 55 - This command will generate the binary satellite S2 cell file `/tmp/foo.dat` with 56 the above S2 ranges. 57 58`satellite_dumpsats2file` 59- Dump the input binary satellite S2 cell file into human-readable text format. 60- Run the tool: `$satellite_dumpsats2file /tmp/foo.dat /tmp/foo` 61 - `/tmp/foo.dat` Input binary satellite S2 cell file. 62 - `/tmp/foo` Output directory which contains the output text files. 63 64`satellite_location_lookup` 65- Check if a location is present in the input satellite S2 file. 66- Run the tool: `$satellite_location_lookup --input-file <...> --lat-degrees <...> 67 --lng-degrees <...>`