Gatts: Write or notify

As a BLE Gatt server, how do I spontaneously write to a characteristic or start a notification? Is there anywhere an example?