BGScript

1 program Added 2026-03-12T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Bluegiga Script, BG Script
Provenance: commit c6c3de4ab0 · authored 2026-03-12T00:59:06+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

SGScript (0.27)Miva Script (0.26)Bitcoin Script (0.25)Scrapscript (0.25)Pine Script (0.24)

LLM-contributed programs

BLE Peripheral Role Example

Provenance: commit c6c3de4ab0 · authored 2026-03-12T00:59:06+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.bgs · added: 2026-03-12T10:00:00Z
# BGScript: Peripheral role example
# Demonstrates event-driven BLE peripheral behavior

dim connected
dim adv_data(31)

event system_boot(major, minor, patch, build, ll_version, protocol_version, hw)
    connected = 0
    # Set advertising parameters (min/max interval in units of 0.625ms, channel map)
    call gap_set_adv_parameters(160, 160, 7)
    # Start advertising as general discoverable, undirected connectable
    call gap_set_mode(gap_general_discoverable, gap_undirected_connectable)
    call system_endpoint_tx(system_endpoint_uart1, 6, "Ready\n")
end

event connection_status(connection, flags, address, address_type, conn_interval, timeout, latency, bonding)
    connected = 1
    call system_endpoint_tx(system_endpoint_uart1, 10, "Connected\n")
end

event connection_disconnected(connection, reason)
    connected = 0
    # Restart advertising after disconnection
    call gap_set_mode(gap_general_discoverable, gap_undirected_connectable)
    call system_endpoint_tx(system_endpoint_uart1, 13, "Disconnected\n")
end

event attributes_value(connection, reason, handle, offset, value_len, value_data)
    # Echo received attribute value back via UART
    call system_endpoint_tx(system_endpoint_uart1, value_len, value_data(0:value_len))
end

Contribute — propose a file extension

Tell us where to find evidence about BGScript (mapped to pl/bgscript). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/BGScript/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← bgraf2 Bgt →