This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in the initialization we let ErlPort know where our python code | |
| # is as well as the python version | |
| {:ok, python} = :python.start([{:python_path, | |
| to_char_list(Path.expand("python"))}, {:python, 'python'}]) | |
| commercial_zones = get_commercial_zones() | |
| |> Enum.map(fn(%{"geometry" => %{"coordinates" => [coordinates]}}) -> | |
| coordinates | |
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace py geo | |
| struct Point { | |
| 1: double lat, | |
| 2: double lng | |
| } | |
| struct Boundary { | |
| 2: list<Point> points | |
| } | |
| service GeoService { | |
| bool blockInZone(1:Boundary block, 2:Boundary zone) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import glob | |
| import sys | |
| sys.path.append('gen-py') | |
| from geo import GeoService | |
| from geo.ttypes import Point, Boundary | |
| from thrift.transport import TSocket | |
| from thrift.transport import TTransport | |
| from thrift.protocol import TBinaryProtocol | |
| from thrift.server import TServer | |
| from shapely.geometry import Polygon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule PythonCalls.Client do | |
| use Riffed.Client, | |
| structs: PythonCalls.Models, | |
| client_opts: [ | |
| host: "localhost", | |
| port: 9090, | |
| retries: 3, | |
| framed: true | |
| ], | |
| service: :geo_service_thrift, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def thrift do | |
| # start the client to connect with the thrift service | |
| PythonCalls.Client.start_link | |
| # convert the zones to Boundary structs defined in the geoservice.thrift file | |
| commercial_zones = get_commercial_zones() | |
| |> Enum.map(fn(%{"geometry" => %{"coordinates" => [coordinates]}}) -> | |
| PythonCalls.Models.Boundary.new(points: getPointsFromCoordinates(coordinates)) | |
| end) | |
| commercial_blocks = get_blocks() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AT+SAPBR=3,1,"CONTYPE","GPRS" | |
| AT+SAPBR=3,1,"APN","hologram" | |
| AT+SAPBR=1,1 | |
| AT+HTTPINIT" | |
| AT+HTTPSSL=1" | |
| AT+HTTPPARA="URL","https://ae076e05.ngrok.io/api/test" | |
| AT+HTTPPARA="CID",1" | |
| AT+HTTPPARA="USERDATA","Authorization: bearer [AUTH_TOKEN]" | |
| AT+HTTPPARA="CONTENT","application/json" | |
| AT+HTTPSCONT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config :nerves_init_gadget, | |
| # 'eth0' sets up the ethernet connection | |
| ifname: "eth0", | |
| address_method: :dhcpd, | |
| mdns_domain: "nerves.local", | |
| node_name: "cellular", | |
| node_host: :mdns_domain, | |
| ssh_console_port: 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CONFIG_MKNOD=y | |
| CONFIG_WC=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CONFIG_USB_SERIAL_OPTION=m | |
| CONFIG_PPP=m | |
| CONFIG_PPP_BSDCOMP=m | |
| CONFIG_PPP_DEFLATE=m | |
| CONFIG_PPP_FILTER=y | |
| CONFIG_PPP_MPPE=m | |
| CONFIG_PPP_MULTILINK=y | |
| CONFIG_PPP_ASYNC=m | |
| CONFIG_PPP_SYNC_TTY=m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BR2_PACKAGE_PPPD=y | |
| BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="${NERVES_DEFCONFIG_DIR}/busybox.fragment" |