Cricket Data Integration Guide

Connect your cricket scoring app to the Clubs Master Recorder App via Bluetooth Low Energy (BLE)

Table of Contents

  1. Overview
  2. Connection Setup
  3. Data Format
  4. Field Reference
  5. Code Examples
  6. Best Practices
  7. Troubleshooting

Overview

The Recorder App receives live cricket score data via Bluetooth Low Energy (BLE) and displays it as an overlay during video recording. Any cricket scoring app can integrate by:

  1. Acting as a BLE Peripheral (GATT Server)
  2. Advertising with specific service UUIDs
  3. Sending JSON score packets via BLE notifications

Architecture:

┌─────────────────────┐         BLE         ┌─────────────────────┐
│  Your Scoring App   │ ──────────────────▶ │   Recorder App      │
│  (BLE Peripheral)   │   JSON Packets       │   (BLE Central)     │
└─────────────────────┘                      └─────────────────────┘

Connection Setup

BLE Service Configuration

Your app must advertise as a BLE peripheral with one of these profiles:

ParameterValue
Device NameMust start with ScoreController
Service UUID6E400001-B5A3-F393-E0A9-E50E24DCCA9E
Characteristic UUID6E400002-B5A3-F393-E0A9-E50E24DCCA9E
Characteristic PropertiesNOTIFY, READ

Connection Flow

  1. Your app starts advertising with the above UUIDs
  2. Recorder App scans for devices with matching names/UUIDs
  3. User selects your device from the list
  4. Connection is established
  5. Your app sends score updates via BLE notifications

Data Format

Packet Structure

Send cricket scores as compact JSON via BLE characteristic notifications.

Minimal Packet (Required Fields)

{
  "i": 1,
  "r": 50,
  "w": 3,
  "o": "10.2"
}

Full Packet (All Fields)

{
  "seq": 15,
  "i": 1,
  "r": 125,
  "w": 4,
  "o": "15.3",
  "t": 180,
  "rr": 8.33,
  "mo": 20,
  "bt": "Team A",
  "bwt": "Team B",
  "bats": [
    { "name": "J. Smith", "score": 67, "isStriker": true },
    { "name": "M. Jones", "score": 42, "isStriker": false }
  ],
  "ls": ["4", "0", "1", "W", "2", "6"],
  "type": "cricket",
  "match": "Final Match",
  "venue": "Main Ground"
}

Packet Size Limits

LimitValueNotes
Maximum packet size1024 bytesPer transmission
BLE MTU20-512 bytesVaries by device
Recommended< 200 bytesFor reliability

Note: For packets larger than device MTU, the app automatically buffers and reassembles fragmented transmissions.

Field Reference

Core Score Fields

FieldAliasesTypeRequiredDescription
iinningsinningsNumbernumberCurrent innings (1 or 2)
rrunsnumberTotal runs scored
wwicketsnumberWickets fallen (0-10)
ooversstringOvers bowled as “O.B” format

Target & Chase Fields

FieldAliasesTypeRequiredDescription
ttargettargetScoretarget_runsnumberTarget score for 2nd innings
fifirstInningsfirstInningsRunsfirst_innings_runsnumberFirst innings total (alternative to target)

Match Details

FieldAliasesTypeRequiredDescription
rrrunRatenumberCurrent run rate (auto-calculated if not sent)
momaxOverstotalOversnumberMaximum overs in match (e.g., 20, 50)
btleftTeamhomestringBatting team name
bwtrightTeamawaystringBowling team name
typestringSport type (always “cricket”)
matchstringMatch name/title
venuestringVenue/ground name

Batsmen Data

FieldAliasesTypeRequiredDescription
batsbatsmenarrayCurrent batsmen (see formats below)
bnbatsmenNamesarrayAlternative batsmen format

Batsmen Format 1: Object Array (Recommended)

"bats": [
  { "name": "J. Smith", "score": 67, "isStriker": true },
  { "name": "M. Jones", "score": 42, "isStriker": false }
]

Batsmen Format 2: String Array (Legacy)

"bats": ["* J. Smith 67", "M. Jones 42"]

Use * prefix to indicate striker

Ball Notation

SymbolAlternativesMeaningDisplay Color
WwktwdWkWicketRed
0dotDot ballGray
1SingleLight Green
2Two runsLight Green
3Three runsLight Green
4Four (boundary)Green
6Six (boundary)Dark Green
BlbByes/Leg-byesOrange
-Unknown/MissingGray

Example:

"ls": ["4", "0", "1", "W", "2", "6"]