Package-level declarations

Casio G-Shock B5000/B5600/B2100 API

Description

This library provides an API to communicate and issue commands to the Casio G-Shock B5000, B5600 and B2100 series of watches via the Bluetooth interface. It can perform the following tasks:

  • Set watch's time

  • Set Home Time (Home City)

  • Set Alarms

  • Set Reminders

  • Set watch's settings.

  • Get watch's name

  • Get watch's battery level

  • Set watch's Timer

All the API functions are located in the GShockAPI class.

For a quick start, you can take a look at the /app directory of this project for an example app.

Types

Link copied to clipboard
open class Alarm(var hour: Int, var minute: Int, var enabled: Boolean, var hasHourlyChime: Boolean = false)
Link copied to clipboard
class Event(var title: String, startDate: EventDate?, var endDate: EventDate?, repeatPeriod: RepeatPeriod, daysOfWeek: ArrayList<DayOfWeek>?, var enabled: Boolean, var incompatible: Boolean)
Link copied to clipboard
data class EventAction(val label: String, val action: () -> Unit) : IEventAction
Link copied to clipboard
class EventDate(var year: Int, val month: Month, val day: Int)
Link copied to clipboard
@RequiresApi(value = 26)
class GShockAPI(context: Context)

This class contains all the API functions. This should the the main interface to the library.

Link copied to clipboard
interface IEventAction

This class is used to send RX events to the rest of the library and to the application to inform them of some internal events. For example, when a connection is established, a "ConnectionSetupComplete" event is broadcast. If the application is listening on this event, it can change its UI to reflect this. The app can call Subscriber.start method to start listening to events. Here is an example which can reside in the MainActivity:

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class Settings
Link copied to clipboard
object WatchInfo

This class keeps information about the characteristics of the currently connected watch. Based on that, the application can display different information.