Skip to content

Commit

Permalink
Kebabify. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Oct 4, 2024
1 parent 5858f9c commit 56659c9
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 161 deletions.
42 changes: 21 additions & 21 deletions examples/sara_r4.toit
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@
// be found in the EXAMPLES_LICENSE file.
import cellular
import cellular_connector show Connector Configuration
import cellular-connector show Connector Configuration
import gpio
import http show Client
import log
import net
import u_blox_cellular.sara_r4 show SaraR4
import u-blox-cellular.sara-r4 show SaraR4
import uart


TX_PIN_NUM ::= 16
RX_PIN_NUM ::= 17
PWR_ON_NUM ::= 18
RESET_N_NUM ::= 4
TX-PIN-NUM ::= 16
RX-PIN-NUM ::= 17
PWR-ON-NUM ::= 18
RESET-N-NUM ::= 4

main:
pwr_on := gpio.Pin PWR_ON_NUM
pwr_on.configure --output --open_drain
pwr_on.set 1
reset_n := gpio.Pin RESET_N_NUM
reset_n.configure --output --open_drain
reset_n.set 1
tx := gpio.Pin TX_PIN_NUM
rx := gpio.Pin RX_PIN_NUM

port := uart.Port --tx=tx --rx=rx --baud_rate=cellular.Cellular.DEFAULT_BAUD_RATE

driver := SaraR4 port --pwr_on=(gpio.InvertedPin pwr_on) --reset_n=(gpio.InvertedPin reset_n) --logger=log.default --is_always_online=false
pwr-on := gpio.Pin PWR-ON-NUM
pwr-on.configure --output --open-drain
pwr-on.set 1
reset-n := gpio.Pin RESET-N-NUM
reset-n.configure --output --open-drain
reset-n.set 1
tx := gpio.Pin TX-PIN-NUM
rx := gpio.Pin RX-PIN-NUM

port := uart.Port --tx=tx --rx=rx --baud-rate=cellular.Cellular.DEFAULT-BAUD-RATE

driver := SaraR4 port --pwr-on=(gpio.InvertedPin pwr-on) --reset-n=(gpio.InvertedPin reset-n) --logger=log.default --is-always-online=false
configuration := Configuration "soracom.io" --bands=[8,20]

connector := Connector driver configuration --logger=log.default --rx=rx

connector.connect

visit_google driver.network_interface
visit-google driver.network-interface

visit_google network_interface/net.Interface:
visit-google network-interface/net.Interface:
host := "www.google.com"

client := Client network_interface
client := Client network-interface

response := client.get host "/"

Expand Down
Loading

0 comments on commit 56659c9

Please sign in to comment.