..
 #############################################################
 # This file was automatically generated on 2015-05-08.      #
 #                                                           #
 # If you have a bugfix for this file and want to commit it, #
 # please fix the bug in the generator. You can find a link  #
 # to the generators git repository on tinkerforge.com       #
 #############################################################


:breadcrumbs: <a href="../../index.html">Home</a> / <a href="../../index.html#software-tcpip">Software</a> / TCP/IP - Piezo Buzzer Bricklet

.. |device_identifier_constant| unicode:: 0xA0
   :trim:

.. _piezo_buzzer_bricklet_tcpip:

TCP/IP - Piezo Buzzer Bricklet
==============================

This is the description of the :ref:`TCP/IP protocol <llproto_tcpip>` for the :ref:`Piezo Buzzer Bricklet <piezo_buzzer_bricklet>`. General information and technical
specifications for the Piezo Buzzer Bricklet are summarized in its :ref:`hardware description
<piezo_buzzer_bricklet_description>`.

.. _piezo_buzzer_bricklet_tcpip_api:

API
---

A general description of the TCP/IP protocol structure can be found
:ref:`here <llproto_tcpip>`.




Basic Functions
^^^^^^^^^^^^^^^



.. tcpip:function:: BrickletPiezoBuzzer.beep

 :functionid: 1
 :request duration: uint32

 :noresponse: no response

 Beeps with the duration in ms. For example: If you set a value of 1000,
 the piezo buzzer will beep for one second.
 
.. tcpip:function:: BrickletPiezoBuzzer.morse_code

 :functionid: 2
 :request morse: char[60]

 :noresponse: no response

 Sets morse code that will be played by the piezo buzzer. The morse code
 is given as a string consisting of "." (dot), "-" (minus) and " " (space)
 for *dits*, *dahs* and *pauses*. Every other character is ignored.
 
 For example: If you set the string "...---...", the piezo buzzer will beep
 nine times with the durations "short short short long long long short 
 short short".
 
 The maximum string size is 60.
 


Advanced Functions
^^^^^^^^^^^^^^^^^^

.. tcpip:function:: BrickletPiezoBuzzer.get_identity

 :functionid: 255
 :emptyrequest: empty payload

 :response uid: char[8]
 :response connected_uid: char[8]
 :response position: char
 :response hardware_version: uint8[3]
 :response firmware_version: uint8[3]
 :response device_identifier: uint16

 Returns the UID, the UID where the Bricklet is connected to, 
 the position, the hardware and firmware version as well as the
 device identifier.
 
 The position can be 'a', 'b', 'c' or 'd'.
 
 The device identifier numbers can be found :ref:`here <device_identifier>`.
 |device_identifier_constant|
 


.. _piezo_buzzer_bricklet_tcpip_callbacks:

Callbacks
^^^^^^^^^

.. tcpip:function:: BrickletPiezoBuzzer.CALLBACK_BEEP_FINISHED

 :functionid: 3

 :emptyresponse: empty payload


 This callback is triggered if a beep set by :tcpip:func:`beep <BrickletPiezoBuzzer.beep>` is finished
 
.. tcpip:function:: BrickletPiezoBuzzer.CALLBACK_MORSE_CODE_FINISHED

 :functionid: 4

 :emptyresponse: empty payload


 This callback is triggered if the playback of the morse code set by
 :tcpip:func:`morse_code <BrickletPiezoBuzzer.morse_code>` is finished.
 


