The ProTee SDK will allow 3rd party hardware to connect with The Golf Club Game.
The API can be used to control the server using a 3rd party application.
The system uses JSON over TCP Sockets to transfer data.
VERSION: 1.1
LAST UPDATE: April 16, 2015
SHOT LAUNCHER
Description: Launch shot in TGC
Usage(minimum): {"protocol":"PTLAUNCH", "DATA":{"ballSpeedMPH":"76.2", "ballDirection":"-2", "ballAngle":"17.3", "spinAxis":"7", "backSpin":"3200"}}
Usage(maximum): {"protocol":"PTLAUNCH","DATA":{"ballSpeedMPH":"50.74", "ballSpeedKMH":"76.81", "ballDirection":"-1", "ballAngle":"14", "spinAxis":"12", "backSpin":"2500", "clubSpeedMPH":"38.61", "clubSpeedKMH":"56.59", "clubFace":"-5", "swingPath":"-4", "swingTempo":"1.69", "sweetSpot":"0.2", "faceRelative":"5", "dragFactor":"0.00"}}
SDK RESPONSE MESSAGES
Response: {"protocol":"PTSDK", "INFO":{"status":"102", "message":"Ball launched"}}
Description: Ball is launched in TGC
Response: {"protocol":"PTSDK", "INFO":{"status":"202", "message":"SDK connected"}}
Description: Connection established with ProTee SDK
Response: {"protocol":"PTSDK", "INFO":{"status":"203", "message":"TGC connected"}}
Description: Connection established with TGC
Response: {"protocol":"PTSDK", "INFO":{"status":"205", "message":"TGC not running"}}
Description: The Golf Club Game is not running or not accepting connections
Repsonse: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"SDK protocol input error"}}
Description: Invalid input received
Repsonse: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"Invalid or expired license"}}
Description: Invalid license key used or stored
Response: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"TGC protocol error or invalid license"}}
Description: There was an error in the communication or the license is invalid
Response: {"protocol":"PTSDK", "INFO":{"status":"150", "playerName":"Bob", "courseName":"Yuma Golf Club", "tourName":"World Tour 1", "playerClub":"SW", "playerHand":"RH", "playerDistanceToFlag":"110", "playerSurface":"Fairway"}}
Description: Reports the current player and ball status in TGC
SDK COMMAND PROCESSOR
Command: ping
Description: Use this to keep the connection alive when experiencing connection drops
Usage: {"protocol":"PTCONTROL", "COMMAND":"ping"}
Response: {"protocol":"PTSDK", "INFO":{"status":"500", "message":"PONG"}}
Command: version
Description: Returns the current running ProTee SDK version
Usage: {"protocol":"PTCONTROL", "COMMAND":"version"}
Response: {"protocol":"PTSDK", "INFO":{"status":"501", "message":"<CURRENT SDK VERSION>"}}
Command: machineid
Description: Returns a unique Machine ID required to generate a licensekey
Usage: {"protocol":"PTCONTROL", "COMMAND":"machineid"}
Response: {"protocol":"PTSDK", "INFO":{"status":"502", "message":"<UNIQUE MACHINEID>"}}
Command: validatelicense, input: licensekey
Description: Validate license key
Usage: {"protocol":"PTCONTROL", "COMMAND":"validatelicense", "LICENSE":"<LICENSEKEY>"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"Valid license"}}
Response: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"Invalid or expired license"}}
Command: license
Description: Sends the license key and stores it onto the computer
Usage: {"protocol":"PTCONTROL", "COMMAND":"license", "KEY":"<LICENSEKEY>"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"Valid license"}}
Response: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"Invalid or expired license"}}
Response: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"License already used"}}
Command: removelicense
Description: Delete the license key from the computer
Usage: {"protocol":"PTCONTROL", "COMMAND":"removelicense"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"License removed. Code: XXXXXX"}}
Response: {"protocol":"PTSDK", "INFO":{"status":"201", "message":"License not found"}}
Command: nickname
Description: Use nickname
Usage: {"protocol":"PTCONTROL", "COMMAND":"nickname","ALIAS":"<NICKNAME>"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"Nickname updated"}}
Usage2: {"protocol":"PTCONTROL", "COMMAND":"nickname","ALIAS":"none"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"Nickname removed"}}
Command: debug
Description: Enable debug to log file
Usage: {"protocol":"PTCONTROL", "COMMAND":"debug"}
Response: {"protocol":"PTSDK", "INFO":{"status":"200", "message":"SDK Debug mode activated"}}
Command: quit
Description: Close TGC SDK
Usage: {"protocol":"PTCONTROL", "COMMAND":"quit"}
Response: None
Command: activeplayerstatus (only on version 2.9.4+)
Description: Reports the current player and ball status in TGC
Usage: {"protocol":"PTCONTROL", "COMMAND":"activeplayerstatus"}
Response: {"protocol":"PTSDK", "INFO":{"status":"150", "playerName":"Bob", "courseName":"Yuma Golf Club", "tourName":"World Tour 1", "playerClub":"SW", "playerHand":"RH", "playerDistanceToFlag":"110", "playerSurface":"Fairway"}}
STATUS CODES
100 - 199
100 : Ready for swing
101 : Not ready
102 : Ball launched
103 : Not connected
150 : Player status info
200 - 299 SDK generic messages
200 : Info message
201 : Error message
202 : SDK connected
203 : TGC connected
204 : TGC not connected
205 : TGC not running
500 - 599 SDK command processor
500 : Ping
501 : Version
502 : MachineID
VARIABLES
float ballSpeedMPH = 0.0f; // Ball speed in MPH (ex. 122.8 = 122.8mph)
float ballSpeedKMH = 0.0f; // Ball speed in KMH (ex. 96.2 = 96.2kmh) :: informational -> analysis screen only
float ballDirection = 0.0f; // Ball direction in DEGREES (ex. -5 = 5 degrees left / 8 = 8 degrees right / 0 = straight)
float ballAngle = 0.0f; // Ball launch angle in DEGREES (ex. 24 = 24 degrees / 0 = topped)
float spinAxis = 0.0f; // Ball spin axis in DEGREES (ex. -1.2 = 1.2 degrees left / 2.4 = 2.4 degrees right)
int sideSpin = 0; // Ball side spin in RPM (ex. -350 = 350 degrees left / 575 = 575 degrees right)
int backSpin = 0; // Ball back spin in RPM (ex. 3500 = 3500 rpm)
float clubSpeedMPH = 0.0f; Club speed in MPH (ex. 74.3 = 74.3mph)
float clubSpeedKMH = 0.0f; Club speed in KMH (ex. 45.2 = 45.2kmh) :: informational -> analysis screen only
float clubFace = 0.0f; Club face angle in degrees (ex. -3.2 = 3.2 degrees closed / 4.1 = 4.1 degrees open / 0 = straight) :: informational -> analysis screen only
float swingPath = 0.0f; Club swing path in degrees (ex. -5.1 = 5.1 degrees out-in / 1.2 = 1.2 degrees in-out / 0 = straight) :: informational -> analysis screen only
float swingTempo = 0.0f; // Swing tempo in SECONDS (ex. 1.6 = 1.6 seconds) :: informational -> analysis screen only
float sweetSpot = 0.0f; // Sweet spot deviation in inch (ex. -0.1 = 0.1 inch left / 1.2 = 1.2 inch right / 0 = None) :: informational -> analysis screen only
float faceRelative = 0.0f; // Face relative in degrees (ex. -8.2 = 8.2 degrees left / 3.7 = 3.7 degrees right) :: informational -> analysis screen only
RETURN VALUES TGC 1
playerSurface: TEE, Fairway, Sand, HeavyRough, LightRough, Green
playerClub: DR, W3, W5, I3, I4, I5, I6, I7, I8, I9, PW, SW, LW, PT
playerHand: RH, LH
playerDistanceToFlag: Distance from ball to flag in yards
RETURN VALUES TGC 2019
playerSurface: TEE, Fairway, HeavyRough, LightRough, Rough, Green, Sand, Bunker, Mulch, Path, PineStraw
playerClub: DR, W2, W3, W4, W5,W6, W7, I1, I2, I3, I4, I5, I6, I7, I8, I9, H2, H3, H4, H5, H6, H7, GW, LW, PW, SW, PT
playerHand: RH, LH
playerDistanceToFlag: Distance from ball to flag in yards
SIDE NOTES
a] If only spinAxis and backSpin are transmitted, sideSpin will be calculated from known values
b] If only sideSpin and backSpin are transmitted, spinAxis will be calculated from known values
c] clubSpeedKMH and ballSpeedKMH will be calculated when not transmitted from MPH values
d] All club data will be esitmated from ball data when not transmitted
0 Comments