pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • 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
      • AlarmService
      • AppFocusService
      • BacklightService
      • BatteryStateService
      • CompassService
      • ConnectionService
      • HealthService
      • TickTimerService
      • TouchService
    • 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
    • Gesture Recognizers
    • Layers
      • ActionBarLayer
      • BitmapLayer
      • MenuLayer
      • RotBitmapLayer
      • ScrollLayer
      • SimpleMenuLayer
      • StatusBarLayer
      • TextLayer
    • Light
    • Microphone
    • Preferences
    • Speaker
    • UnobstructedArea
    • Vibes
    • Window
      • ActionMenu
      • NumberWindow
    • Window Stack
  • Worker
  • 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.

void * fxBuildFFI

Optional pointer to an fxBuildFFI function for custom native bindings.

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
#define kModdableCreationFlagDebug (1 << 1)

Flag to enable XS debugging using xsbug. Should be used in combination with pebble build -debug.

See Also

ModdableCreationRecord

Need some help?

Functions

  • moddable_createMachine

Data Structures

  • ModdableCreationRecord

Macro Defintions

  • kModdableCreationFlagLogInstrumentation
  • kModdableCreationFlagDebug

Getting Help

Do you have questions about the Pebble SDK?

Do you need some help understanding something on this page?

Ask on the developer forum.