Write block data to an NDEF compatible tag.

        This is a convinience method to write block data to a tag that
        has system code 0x12FC (NDEF). For other tags this method
        simply does nothing. The *data* to write must be a string or
        bytearray with length equal ``16 * len(blocks)``. All
        parameters following *data* are interpreted as block numbers
        to write. To actually pass a list of block numbers requires
        unpacking. The following example calls would have the same
        effect of writing 32 byte zeros into blocks 1 and 8.::

            tag.write_to_ndef_service(32 * "\\0", 1, 8)
            tag.write_to_ndef_service(32 * "\\0", *list(1, 8))

        Command execution errors raise :exc:`~nfc.tag.TagCommandError`.

def write_to_ndef_service(self, data, *blocks):
        """Write block data to an NDEF compatible tag.

        This is a convinience method to write block data to a tag that
        has system code 0x12FC (NDEF). For other tags this method
        simply does nothing. The *data* to write must be a string or
        bytearray with length equal ``16 * len(blocks)``. All
        parameters following *data* are interpreted as block numbers
        to write. To actually pass a list of block numbers requires
        unpacking. The following example calls would have the same
        effect of writing 32 byte zeros into blocks 1 and 8.::

            tag.write_to_ndef_service(32 * "\\0", 1, 8)
            tag.write_to_ndef_service(32 * "\\0", *list(1, 8))

        Command execution errors raise :exc:`~nfc.tag.TagCommandError`.

        """
        if self.sys == 0x12FC:
            sc_list = [ServiceCode(0, 0b001001)]
            bc_list = [BlockCode(n) for n in blocks]
            self.write_without_encryption(sc_list, bc_list, data)