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)
Related languages
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
# 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