pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • Examples
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

Pebble C API

  • Pebble C API
  • Moddable API (Alloy)
  • PebbleKit JS
  • PebbleKit iOS
  • PebbleKit Android
  • Foundation
    • Alloy
    • App
    • App Communication
    • App Glance
    • AppMessage
    • AppSync
    • AppWorker
    • DataLogging
    • DataStructures
      • UUID
    • Dictation
    • Dictionary
    • Event Service
      • AccelerometerService
      • AppFocusService
      • BatteryStateService
      • CompassService
      • ConnectionService
      • HealthService
      • TickTimerService
    • Exit Reason
    • Internationalization
    • Launch Reason
    • Logging
    • Math
    • Memory Management
    • Platform
    • Resources
      • File Formats
    • Storage
    • Timer
    • Wakeup
    • Wall Time
    • WatchInfo
  • Graphics
    • Draw Commands
    • Drawing Paths
    • Drawing Primitives
    • Drawing Text
    • Fonts
    • Graphics Context
    • Graphics Types
      • Color Definitions
  • User Interface
    • Animation
      • PropertyAnimation
    • Clicks
    • Layers
      • ActionBarLayer
      • BitmapLayer
      • MenuLayer
      • RotBitmapLayer
      • ScrollLayer
      • SimpleMenuLayer
      • StatusBarLayer
      • TextLayer
    • Light
    • Preferences
    • UnobstructedArea
    • Vibes
    • Window
      • ActionMenu
      • NumberWindow
    • Window Stack
  • Standard C
    • Format
    • Locale
    • Math
    • Memory
    • String
    • Time

The APIs on this page will only work with SDK 4.9+.

Alloy

Function Documentation

void moddable_createMachine(ModdableCreationRecord * creation)

Create and start a Moddable XS virtual machine for an Alloy app.

Parameters

creation

Configuration record, or NULL for default settings.

See Also

ModdableCreationRecord

Data Structure Documentation

struct ModdableCreationRecord

Configuration record for creating a Moddable XS virtual machine. Used with moddable_createMachine() to customize the JS runtime. Set recordSize to sizeof(ModdableCreationRecord) for version compatibility.

Data Fields

uint32_t recordSize

Size of this struct in bytes (for versioning)

uint32_t stack

Stack size in bytes (0 for default)

uint32_t slot

Slot heap size in bytes (0 for default)

uint32_t chunk

Chunk heap size in bytes (0 for default)

uint32_t flags

Combination of kModdableCreationFlag* values.

Macro Definition Documentation

#define kModdableCreationFlagLogInstrumentation (1 << 0)

Flag to enable XS instrumentation logging over Bluetooth. When set, the Moddable XS engine will log instrumentation data (e.g. memory usage, slot/chunk/stack statistics) via app_log. Logging is only active when a Bluetooth log listener is connected; otherwise this flag has no effect.

See Also

ModdableCreationRecord

Need some help?

Functions

  • moddable_createMachine

Data Structures

  • ModdableCreationRecord

Macro Defintions

  • kModdableCreationFlagLogInstrumentation

Getting Help

Do you have questions about the Pebble SDK?

Do you need some help understanding something on this page?

You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can join us on the Discord!