Plugin qnx.bluetooth.pbap

qnx.bluetooth.pbap

Allows access to address book information over Bluetooth PBAP.

Events

bluetoothpbapstatechange

Fired when the state of a service has changed

Event data

{Object}

Example
{
     service: 'SERVICE_BLUETOOTH',
     state: 'STATE_CONNECTED'
}

bluetoothpbapstatuschange

Fired when the status of the contact service has changed, e.g. the contact store is refreshing or service is ready

Event data

{Object}

Example
{
     service: 'SERVICE_BLUETOOTH'
     status: 'REFRESHING'
}
Deprecated:
  • Deprecated

    Members

    FIELD_EMAIL_1

    email1 field name for use in FilterExpression

    FIELD_EMAIL_2

    email2 field name for use in FilterExpression

    FIELD_EMAIL_3

    email3 field name for use in FilterExpression

    FIELD_FIRST_NAME

    firstName field name for use in FilterExpression

    FIELD_HOME_PHONE

    homePhone field name for use in FilterExpression

    FIELD_HOME_PHONE_2

    homePhone2 field name for use in FilterExpression

    FIELD_LAST_NAME

    lastName field name for use in FilterExpression

    FIELD_MOBILE_PHONE

    mobilePhone field name for use in FilterExpression

    FIELD_OTHER_PHONE

    otherPhone field name for use in FilterExpression

    FIELD_WORK_PHONE

    workPhone field name for use in FilterExpression

    FIELD_WORK_PHONE_2

    workPhone2 field name for use in FilterExpression

    STATE_CONNECTED

    PBAP service connected state

    STATE_CONNECTING

    PBAP service in process of connecting

    STATE_DISCONNECTED

    PBAP service disconnected state

    STATUS_ERROR

    PBAP service error status

    STATUS_READY

    PBAP service ready status

    STATUS_REFRESHING

    PBAP service refreshing status

    Methods

    Contact

    Parameters:
    Name Type Argument Description
    properties Object <optional>
    The properties argument can be used to initialize the Contact instance's properties.
    Properties:
    Name Type Description
    anniversary String The anniversary of the Contact in ISO 8601 format.
    birthday String The birthday of the Contact in ISO 8601 format.
    categories String A comma-separated list of categories to which this Contact belongs.
    company String The Contact's company.
    email1 String Primary email address.
    email2 String Secondary email address.
    email3 String Tertiary email address.
    faxPhone String The Contact's fax number.
    firstName String First name.
    homeAddress1 String Primary home address information.
    homeAddress2 String Secondary home address inofrmation.
    homeAddressCity String Home address city.
    homeAddressCountry String Home address country.
    homeAddressStateProvince String Home address state or province.
    homeAddressZipPostal String Home address zip or postal code.
    homePhone String Primary home phone number.
    homePhone2 String Secondary home phone number.
    jobTitle String The Contact's job title.
    lastName String Last name.
    mobilePhone String Mobile phone number.
    note String Additional contact information.
    otherPhone String Other phone number.
    pagerPhone String Pager number.
    picture String The fully qualified system path to the Contact's photo.
    pin String The Contact's device PIN.
    title String The Contact's title or titles.
    uid String Unique identifier for this Contact.
    user1 String User-defined field.
    user2 String User-defined field.
    user3 String User-defined field.
    user4 String User-defined field.
    webpage String The Contact's webpage URI.
    workAddress1 String Primary work address information.
    workAddress2 String Secondary work address information.
    workAddressCity String Work address city.
    workAddressCountry String Work address country.
    workAddressStateProvince String Work address state or province.
    workAddressZipPostal String Work address zip or postal code.
    workPhone String Primary work phone number.
    workPhone2 String Secondary work phone number.
    Example
    // The following code demonstrates how to create a new Contact object with its name
    // defaulted to 'John Doe'
    var contact = new qnx.bluetooth.pbap.Contact({ firstName: 'John', lastName: 'Doe'});

    FilterExpression

    Parameters:
    Name Type Description
    leftField String | qnx.bluetooth.pbap.FilterExpression The field name or FilterExpression.
    operator String The filter operator, e.g. '=', '<', '>', '<>', 'LIKE', 'AND', 'OR'.
    rightField String | qnx.bluetooth.pbap.FilterExpression The field value or additional FilterExpression.
    Examples
    // The following code demonstrates how to create a new FilterExpression and get a
    // list of contacts filtered by last name = 'Doe'
    var filter = new qnx.bluetooth.pbap.FilterExpression(qnx.bluetooth.pbap.FIELD_LAST_NAME, '=', 'Doe'),
        filteredContacts = qnx.bluetooth.pbap.find(filter);
    // The leftField and rightField properties can also be FilterExpression objects themselves,
    // allowing the construction of complex filter expressions. The following code demonstrates
    // how to find a contact whose home number or mobile number is '555-555-5555'
    var filter = new qnx.bluetooth.pbap.FilterExpression(
            new qnx.bluetooth.pbap.FilterExpression(qnx.bluetooth.pbap.FIELD_HOME_PHONE, '=', '555-555-5555'),
            'OR',
            new qnx.bluetooth.pbap.FilterExpression(qnx.bluetooth.pbap.FIELD_MOBILE_PHONE, '=', '555-555-5555')),
        filteredContacts = qnx.bluetooth.pbap.find(filter);

    find

    Returns an array of zero or more qnx.bluetooth.pbap.Contact instances.
    Parameters:
    Name Type Argument Description
    filter qnx.bluetooth.pbap.FilterExpression <optional>
    The qnx.bluetooth.pbap.FilterExpression to apply against the phone book database.
    orderBy String <optional>
    The field name to order by. If this parameter is not specified, the results will be sorted first by last name ascending, then first name ascending.
    isAscending Boolean <optional>
    If an orderBy parameter is supplied, changes the order direction to ascending if true, descending if false. If an orderBy parameter is not specified, isAscending has no effect. Defaults to false.
    limit Number <optional>
    The maximum number of Contact instances to return. Defaults to -1 (no limit).
    offset Number <optional>
    Specifies the record offset. Defaults to 0 (no offset).

    getState

    Get the current state of the PBAP service
    Returns:
    The contact service state. Possible values are qnx.bluetooth.pbap state constants, or null if the service state is not available
    Type
    • String

    getStatus

    Get the current status of the PBAP service
    Returns:
    The contact service status. Possible values are qnx.bluetooth.pbap status constants, or null if the service status is not available
    Type
    • String

    refresh

    Force the PBAP phone book data to be refreshed from the device

    remove

    qnx.bluetooth.pbap.Contact instance function to remove this Contact from the device PIM storage.
    Deprecated:
    • Unsupported.

      save

      qnx.bluetooth.pbap.Contact instance function to create or update the Contact in the device PIM storage. If creating a new contact, the Contact's uid property will be updated to the new unique identifier for the created Contact.
      Deprecated:
      • Unsupported.