Phase 4 of the docs portion of the rfc-5737-cleanup. Replaces all 192.168.1.x example IPs in tracked .md / .txt files with the equivalent last-octet under 192.0.2.x. 192.168.1.x is RFC-1918 private space and routes on real networks, which leaves readers guessing whether a documented IP is a placeholder or a documented LAN. 192.0.2.0/24 is reserved by RFC 5737 exclusively for documentation — readers know on sight that they're examples. 58 files touched, 551 line pairs. Includes .github issue/PR templates, all docs/ references, example READMEs, and one script doc. No code changes, no test changes; test files still carry the 192.168.1.x placeholder pending Phase 2 in _/RFC-5737-cleanup/assessment.md. Also fixed a small fallout in docs/analysis/ANONYMIZATION-SUMMARY.md where the explanatory sentence "a reader can't tell whether 192.168.1.10 is a placeholder or a documented LAN address" had itself been swept by the regex (inverting the point); restored the literal example and noted the sweep progress inline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.7 KiB
Service Availability Example
This example demonstrates how to use the GetServiceAvailability() method to retrieve and analyze service availability from a Bose SoundTouch device. This information can be used to provide better user feedback about supported stations and sources.
What is Service Availability?
The /serviceAvailability endpoint provides information about which music services and input sources are theoretically available on the device, along with reasons why certain services might be unavailable.
This is different from the /sources endpoint, which shows currently configured and ready sources. Service availability shows what's possible, while sources show what's currently set up.
Running the Example
Method 1: Command Line Argument
go run main.go 192.0.2.100
Method 2: Environment Variable
SOUNDTOUCH_HOST=192.0.2.100 go run main.go
Replace 192.0.2.100 with your SoundTouch device's IP address.
Example Output
============================================================
SOUNDTOUCH SERVICE AVAILABILITY REPORT
============================================================
Total Services: 13
Available Services: 9
Unavailable Services: 4
📱 AVAILABLE SERVICES:
✅ AirPlay
✅ Amazon Music
✅ Deezer
✅ iHeartRadio
✅ Internet Radio
✅ Local Music Library
✅ Pandora
✅ Spotify
✅ TuneIn Radio
❌ UNAVAILABLE SERVICES:
❌ Amazon Alexa
❌ Bluetooth (INVALID_SOURCE_TYPE)
❌ BMX
❌ Notifications
🎵 STREAMING SERVICES:
✅ Spotify
✅ Pandora
✅ TuneIn Radio
✅ Amazon Music
✅ Deezer
✅ iHeartRadio
✅ Internet Radio
Summary: 7/7 streaming services available
🔗 LOCAL INPUT SERVICES:
❌ Bluetooth
✅ AirPlay
✅ Local Music Library
Summary: 2/3 local services available
Key Features Demonstrated
1. Service Availability Analysis
- Total service count and availability breakdown
- Categorization into streaming vs. local services
- Detailed status for each service type
2. User-Friendly Recommendations
- Smart suggestions based on available services
- Alternative recommendations when preferred services are unavailable
- Clear status indicators for popular services
3. Troubleshooting Information
- Specific reasons why services are unavailable
- Helpful tips for resolving common issues
- Service-specific guidance
4. Comparison with Configured Sources
- Side-by-side comparison with the
/sourcesendpoint - Identification of available but unconfigured services
- Guidance on setting up available services
Use Cases
Application Development
Use this information to:
- Show users which music services they can potentially use
- Provide helpful setup guidance for available but unconfigured services
- Display appropriate UI elements based on device capabilities
- Offer fallback options when preferred services are unavailable
User Support
- Diagnose why certain services aren't working
- Provide specific troubleshooting steps
- Help users understand their device's capabilities
- Guide users through service setup
Device Management
- Audit service capabilities across multiple devices
- Plan music service deployments
- Understand device limitations
API Methods Used
This example demonstrates several key methods from the ServiceAvailability API:
// Get service availability
serviceAvailability, err := client.GetServiceAvailability()
// Check specific services
hasSpotify := serviceAvailability.HasSpotify()
hasBluetooth := serviceAvailability.HasBluetooth()
// Get service details
spotifyService := serviceAvailability.GetServiceByType(models.ServiceTypeSpotify)
if spotifyService != nil && !spotifyService.IsAvailable {
reason := spotifyService.GetReason()
}
// Get categorized services
streamingServices := serviceAvailability.GetStreamingServices()
localServices := serviceAvailability.GetLocalServices()
// Get availability counts
total := serviceAvailability.GetServiceCount()
available := serviceAvailability.GetAvailableServiceCount()
unavailable := serviceAvailability.GetUnavailableServiceCount()
Integration Ideas
This functionality can be integrated into:
- Mobile apps to show service status
- Web dashboards for device management
- Setup wizards for new devices
- Troubleshooting tools
- Music service recommendation systems
Notes
- Service availability may change based on device firmware, network connectivity, and account status
- Some services may show as available but require additional setup (like signing into streaming accounts)
- The
reasonfield provides valuable context for why services are unavailable - Always compare with the
/sourcesendpoint for a complete picture of device capabilities