For anyone looking at this question later, I'll try to embed some example code.
Can I create new(user defined) attributes onto the device?
Can I write/change the existing attributes on the device?
@stathisv put the links for the Bluegiga documentation, but here are some practical examples: https://github.com/sureshjoshi/ble113-firmware-examples
You need to edit the gatt.xml, define a service (or use existing) and define a characteristic. For example:
<service uuid="aaa51666-e7cb-469b-8e4d-2742f1ba7aaa" advertise="true">
<characteristic uuid="0dddd780-b042-4876-aae1-112855353ddd" id="xgatt_who">
<description>Who Am I</description>
<properties read="true" notify="true" />
<value length="1" />
</characteristic>
</service>
If I intend to store any data onto the device, how can this be done?
I've written a compilable example here: https://github.com/sureshjoshi/ble113-firmware-examples/tree/master/Persistence, but the basics are as simple as two API commands:
# Write value to PS-store
call flash_ps_save($8000, 2, value_data(0:2))
# Read value from PS-store
call flash_ps_load($8000)(read_result, len, data(0:2))
The only real trick is the $8000 which is the first usable (persistent) memory address according the Bluegiga documentation.
Please note, that if you overwrite the BLE112/BLE113 firmware, either using the CC-Debugger or OTA programming, you wipe out all of your persistent flash information.